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 logic to parse JSON responses in Form wrapper #15

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

ayushn21
Copy link
Contributor

When using the form wrapper, there's a mechanism to process JSON encoded responses, but this won't work if the content-type header isn't EXACTLY application/json. It can sometimes be application/json; charset=UTF8 or something like that.

This change splits the string on the ; and uses the first part to lookup the parser.

I'm not sure what the best way to test this is though.

Types of Changes

  • Bug fix.

Contribution

@ioquatix ioquatix merged commit 15244c1 into socketry:main Jan 4, 2025
16 of 20 checks passed
@ioquatix
Copy link
Member

ioquatix commented Jan 4, 2025

The part before the ; is referred to as the media type. On the surface, this looks okay to me, but I'll consider if there are bigger implications.

@ayushn21 ayushn21 deleted the fix-form-wrapper branch January 4, 2025 08:08
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.

2 participants