-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix too lax application/json prefix-only matching #6180
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6180 +/- ##
=======================================
Coverage 93.29% 93.30%
=======================================
Files 102 103 +1
Lines 30351 30362 +11
Branches 2729 2729
=======================================
+ Hits 28315 28328 +13
+ Misses 1858 1857 -1
+ Partials 178 177 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Note that this will conflict with #6181, will fix the other after one of these is merged. |
#6181 is merged, please fix conflicts |
382c326
to
1fbddb6
Compare
Done/rebased. |
E.g. application/jsonfoobar is not expected for it, but ones with parameters -- for example charset -- are. The IANA registered application/json-seq is a good example.
1fbddb6
to
4a4dc9f
Compare
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
for more information, see https://pre-commit.ci
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.
Would you please replace resp.headers['Content-Type']
check with resp.content_type
?
It can simplify things by dropping parameters support (e.g. charset
) from regexp.
Done. |
I don't have any additional comments beyond those few nitpicks so I'll let @asvetlov decide when to merge this. |
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
LGTM |
What do these changes do?
Fix too lax application/json matching.
For example,
application/jsonfoo
orapplication/json-seq
should not be treated as valid for JSON.Are there changes in behavior for the user?
Related issue number
Fixes #5896
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.