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

Invalid body causes a 500 #1507

Closed
xsawyerx opened this issue Jul 4, 2019 · 4 comments
Closed

Invalid body causes a 500 #1507

xsawyerx opened this issue Jul 4, 2019 · 4 comments
Labels

Comments

@xsawyerx
Copy link
Member

xsawyerx commented Jul 4, 2019

When making a call with an invalid body, HTTP::Body croaks, which triggers a 400.

I think we should instead return a 400 for an invalid request.

Objections?

@xsawyerx xsawyerx added the Bug label Jul 4, 2019
@cromedome
Copy link
Contributor

No objection! 👍

@ice-lenor
Copy link

The issue is also present in Dancer v1
PerlDancer/Dancer#1167

veryrusty added a commit that referenced this issue Jul 5, 2019
There's a grey area here between throwing a 400 Bad Request, and 500
Internal Error. As re-sending a failed request at this point is always
going to fail, send this as a 400 response; so the client doesn't try
again.

This is a change in behaviour in core; we always sent this as a 500
error before. However issues #1496, #1507 and #1056 point to a 400 error
being the better option.
@xsawyerx
Copy link
Member Author

xsawyerx commented Jul 8, 2019

Reference tests for this: #1508

cromedome pushed a commit that referenced this issue Apr 11, 2020
There's a grey area here between throwing a 400 Bad Request, and 500
Internal Error. As re-sending a failed request at this point is always
going to fail, send this as a 400 response; so the client doesn't try
again.

This is a change in behaviour in core; we always sent this as a 500
error before. However issues #1496, #1507 and #1056 point to a 400 error
being the better option.
@cromedome cromedome added this to the April 2020 Release milestone Apr 13, 2020
@cromedome
Copy link
Contributor

Resolved by #1509.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants