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

Rack::JSONBodyParser. Do not rescue JSON:ParserError #181

Merged
merged 1 commit into from Oct 24, 2020

Conversation

Juanmcuello
Copy link
Contributor

@Juanmcuello Juanmcuello commented Oct 24, 2020

Do not rescue JSON:ParserError if it was raised inside de app.

I was trying to figure out why my app was returning 400 until I found that it was due to a JSON::ParserError rescued by this middleware.

This PR makes the rescue block to only catch this exception if it was raised when parsing the params and not when it was raised by the app.

Do not rescue JSON:ParserError if it was raised inside de app.
@andrykonchin
Copy link
Collaborator

Looks good! Thank you for the fix.

@andrykonchin andrykonchin merged commit 095edc9 into rack:master Oct 24, 2020
@Juanmcuello Juanmcuello deleted the json-body-parser-fix branch October 24, 2020 18:20
@jfirebaugh
Copy link

Can we please have a release with this fix included? Thank you!

@mpalmer
Copy link
Contributor

mpalmer commented Nov 30, 2020

Yes... yes we can.

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.

None yet

4 participants