Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch CSS over HTTP when URL lacks extension; convert font CDN stylesheets @imports to convert to links instead of fetching #1357

Merged
merged 3 commits into from Aug 27, 2018

Conversation

3 participants
@westonruter
Copy link
Member

westonruter commented Aug 25, 2018

If there is a stylesheet link with a URL which does not end in css, fetch it over HTTP instead of throwing a validation error.

Additionally, if there is a stylesheet that contains an @import to a stylesheet URL which is whitelisted CDN for fonts such as:

@import "https://fonts.googleapis.com/css?family=Merriweather:300";

Then instead of fetching the CSS to inline, opt instead to convert into a normal link tag:

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merriweather:300">

Fixes #1317

@westonruter westonruter added this to the v1.0 milestone Aug 25, 2018

@westonruter westonruter changed the title [WIP] Convert font CDN stylesheets @imports to convert to links; allow fetch external CSS without extensions Fetch CSS over HTTP when URL lacks extension; convert font CDN stylesheets @imports to convert to links instead of fetching Aug 25, 2018

@westonruter westonruter requested review from amedina and hellofromtonya Aug 25, 2018

@hellofromtonya
Copy link
Contributor

hellofromtonya left a comment

Looks good. Great job @westonruter

@hellofromtonya hellofromtonya added this to Ready for QA in v1.0 Aug 27, 2018

@westonruter westonruter merged commit a6f8eae into develop Aug 27, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the fix/external-stylesheet-imports branch Aug 27, 2018

@westonruter

This comment has been minimized.

Copy link
Member Author

westonruter commented Sep 5, 2018

See also Automattic/nginx-http-concat#41 which would bypasse VIP's http-concat for CSS when is_amp_endpoint(). Having this in place will improve the AMP integration yet further, as it would eliminate redundant and unnecessary work.

@kienstra

This comment has been minimized.

Copy link
Collaborator

kienstra commented Sep 18, 2018

Moving To 'Ready For Merging'

If it's alright, I'm moving this to 'Ready For Merging,' as I don't think it needs functional testing. Feel free to move it back.

@kienstra kienstra moved this from Ready for QA to Ready for Merging in v1.0 Sep 18, 2018

@kienstra kienstra moved this from Ready for Merging to In Production in v1.0 Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.