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

Always send a JSON content type #9

Merged
merged 3 commits into from
Feb 4, 2021
Merged

Conversation

halorgium
Copy link
Contributor

Turns out when telex receives a request body which does not have a Content-Type header, it assumes that it can Rack::Utils.parse_nested_query the request body.

This means if you send a % symbol, the parse fails with an ArgumentError and returns a 400 status to the client.

By sending the Content-Type headers, Rack does not attempt to parse the request body, but leaves the JSON decoding to the application.

@halorgium halorgium added the bug label Jul 10, 2020
@halorgium halorgium self-assigned this Jul 10, 2020
Copy link

@amerine amerine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from master to main February 4, 2021 20:27
@beanieboi beanieboi merged commit 7473758 into main Feb 4, 2021
@beanieboi beanieboi deleted the content-type-header-is-needed branch February 4, 2021 20:29
@beanieboi beanieboi restored the content-type-header-is-needed branch February 4, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants