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

fix: parse JSON body when Content-Type has charset #391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slagiewka
Copy link

@slagiewka slagiewka commented Dec 22, 2024

Or other parameters.

In accordance with RFC 91101, Content-Type contains first and
foremost the media type. It can be followed by key-value pairs of
parameters.

This change supports extracting the media type and effectively
discarding the other parameters as these are currently irrelevant to
body parsing. The result media type is then matched against previously
used JSON type tests.

Closes #229
Closes #341

Footnotes

  1. https://www.rfc-editor.org/rfc/rfc9110.html

@slagiewka slagiewka requested a review from a team as a code owner December 22, 2024 15:24
@apollo-cla
Copy link

@slagiewka: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link

codesandbox-ci bot commented Dec 22, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@slagiewka slagiewka force-pushed the handle_content_type_extra_charset branch 2 times, most recently from 3eb471b to c6a9eaa Compare December 22, 2024 15:32
@slagiewka
Copy link
Author

@trevor-scheer please have a look 🙂

Or other parameters.

In accordance with RFC 9110[^1], Content-Type contains first and
foremost the media type. It can be followed by key-value pairs of
parameters.

This change supports extracting the media type and effectively
discarding the other parameters as these are currently irrelevant to
body parsing. The result media type is then matched against previously
used JSON type tests.

Closes apollographql#229
Closes apollographql#341

[^1]:https://www.rfc-editor.org/rfc/rfc9110.html
@slagiewka slagiewka force-pushed the handle_content_type_extra_charset branch from c6a9eaa to f5378ca Compare December 22, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON body is not parsed when Content-Type contains a charset Refine Content-Type negotiation
2 participants