-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[receiver/otlpreceiver] improve request's content-type check #7451
Conversation
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.
This will also need a changelog entry, there's a guide on how to add one here.
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 good to me. Thanks for fixing this.
.chloggen/otlpreceiver_support_content-type_with_parameters.yaml
Outdated
Show resolved
Hide resolved
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #7451 +/- ##
=======================================
Coverage 91.11% 91.11%
=======================================
Files 292 292
Lines 14205 14210 +5
=======================================
+ Hits 12943 12948 +5
Misses 996 996
Partials 266 266
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
content-type header could contain optional parameters after the mime-type, do not reject requests in this case
…lemetry#7451) content-type header could contain optional parameters after the mime-type, do not reject requests in this case
content-type header could contain optional parameters after the mime-type, do not reject requests in this case
note: this is my first PR in this repo, excuse me if I miss something and guide me on moving forward, thanks!
Description:
If the HTTP request contains a valid content-type header in the form
application/json; charset=utf-8
the receiver replies with415 unsupported media type, supported:
.Also, by spec, header is case-insensitive, so we take care also of this.
Link to tracking Issue:
Fixes #7452
Testing:
Added unit tests to verify the bug and see that the change fixes it