-
Notifications
You must be signed in to change notification settings - Fork 154
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
only replace font urls when content type is not present or it is a text #1867
Conversation
This comment has been minimized.
This comment has been minimized.
Coverage report
Test suite run success1133 tests passing in 548 suites. Report generated by 🧪jest coverage report action from eb0f06f |
packages/cli-kit/assets/cli-ruby/test/shopify-cli/theme/dev_server/cdn_fonts_test.rb
Show resolved
Hide resolved
if content_type.nil? || content_type == "" || content_type&.start_with?("text/") | ||
Rack::Response.new(replace_font_urls(body), status, headers).finish | ||
else | ||
Rack::Response.new(body, status, headers).finish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was concerned that this changes the response type from an array to an object, but this returns the same 3 tuple array.
https://www.rubydoc.info/github/rack/rack/Rack%2FResponse:finish
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for this! 🎉 🚀
By the way, PLEASE do add a changeset before merging. So we can include the fix in the changelog. |
And the changeset should be patch-level! |
Is this good for a changeset entry? |
WHY are these changes introduced?
Fixes https://github.com/Shopify/assets/issues/653
New vanity urls are breaking theme development
related to #1862
WHAT is this pull request doing?
Ensure the fonts url replacement only happens on text assets (or when content type is not present)
How to test your changes?
bundle exec rake test TEST=test/shopify-cli/theme/dev_server/cdn_fonts_test.rb
OR
Measuring impact
How do we know this change was effective? Please choose one:
Checklist
dev
ordeploy
have been reflected in the internal flowchart.