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

Return bad request status code if request body is malformed #9

Merged
merged 3 commits into from Nov 18, 2022

Conversation

efcasado
Copy link
Contributor

@efcasado efcasado commented Jul 22, 2022

About

At the time of this writing, krakend-jsonschema returns a 500 - Internal Server Error in the following scenarios:

  • When the request body is empty
  • When the request body is a non-valid JSON data structure

This PR modifies the above behaviour to return a 400 - Bad Request status code in such scenarios.

@efcasado efcasado force-pushed the bad-request-when-malformed-body branch from fb24c6a to 5eb7ac6 Compare July 22, 2022 14:29
@efcasado efcasado force-pushed the bad-request-when-malformed-body branch from 5eb7ac6 to 05c8932 Compare July 22, 2022 14:31
@efcasado
Copy link
Contributor Author

Sorry for approaching you, @kpacha, like this 😳 I only want to make sure this did not fall between the cracks since I opened it during summer vacation.

Also, curious to hear your thoughts and feedback.

Oh, and also thanks for the amazing work you are doing with this project (and krakend in general! 🙌).

@taik0 taik0 requested a review from kpacha September 14, 2022 10:00
@kpacha kpacha merged commit f597016 into krakend:master Nov 18, 2022
@kpacha
Copy link
Member

kpacha commented Nov 18, 2022

@efcasado thanks for your contribution!

We'll add a minor modification so the actual error gets propagated

Cheers

@alombarte
Copy link
Member

Hola @efcasado,

Thank you for your pull request, the fix will be included in the next KrakenD release

@alombarte alombarte added the bug Something isn't working label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants