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

westonruter
Copy link
Member

@westonruter 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
Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@westonruter westonruter deleted the fix/external-stylesheet-imports branch August 27, 2018 21:45
@westonruter
Copy link
Member Author

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
Copy link
Contributor

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
Labels
None yet
Projects
No open projects
v1.0
In Production
Development

Successfully merging this pull request may close these issues.

None yet

3 participants