-
-
Notifications
You must be signed in to change notification settings - Fork 377
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 add charset to content-type header if defined in mime db #351
Conversation
8d74a68
to
dda27f5
Compare
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.
Looks very good! I am afraid what it is breaking change and can break code for some people, what do you think?
Only thing maybe breaking is 'text/html' no longer has the charset. I assume because it could be multiple different values. It is usually set with the meta tag |
I could special case text/html to add it so this isn't potentially breaking. |
@gpoitch feel free to send |
dda27f5
to
7eaeb9e
Compare
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
==========================================
+ Coverage 96.82% 96.86% +0.03%
==========================================
Files 7 7
Lines 252 255 +3
==========================================
+ Hits 244 247 +3
Misses 8 8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
==========================================
+ Coverage 96.77% 96.78% +0.01%
==========================================
Files 12 12
Lines 279 280 +1
Branches 81 81
==========================================
+ Hits 270 271 +1
Misses 9 9
Continue to review full report at Codecov.
|
9f610a1
to
21a08f1
Compare
21a08f1
to
d4e4c6d
Compare
/cc @gpoitch can you rebase PR? I think we are ready to merge and release this |
@evilebottnawi good to go |
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.
Thanks
@gpoitch A am little afraid about breaking change, maybe we can merge this and release after holidays? For fast fixing/reverting if problem will be for many developers? |
@evilebottnawi There is a special condition to avoid the breaking change. As an alternative, we could maintain our own blacklist (.wasm, .usdz so far) instead of using mime-db. That would leave everything else as-is. |
@gpoitch i think your solution is right, but i think we really can break some app, better release this as major, maybe we can add temporary workaround (example new option) |
Hmm been thinking about it. I think maybe just blacklisting |
@evilebottnawi Here's a simpler/safer alternative PR: #357 |
4e926c0
to
ab3f043
Compare
Close in favor #357 |
What kind of change does this PR introduce?
bugfix/functionality change
Did you add tests for your changes?
Yes
Summary
Closes #350
charset=utf-8
was being appended to the content-type header of every mime type regardless if it required it (#136). This PR uses mime-db to look up the charset for each mime type and add it appropriately.Does this PR introduce a breaking change?
Don't think so unless someone was relying on the previously incorrect behavior.
Other information