Skip to content

Properly handle malformed request body and content type #320

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

Merged
merged 2 commits into from
Nov 21, 2020

Conversation

aliniknejad
Copy link
Contributor

@aliniknejad aliniknejad commented Nov 21, 2020

Hi @JamesNK

This PR includes two changes to gRPC Http API:

  • For incorrect content-type, which is currently anything but application/json, it will return a 400 http error code, rather than 500.
  • For malformed request body payloads, whether it's a malformed json or it doesn't conform to the request type, it will return 400 with the appropriate error message.

This will ensure a 400 http status will be returned, signalling the input error, with appropriate error message and gRPC status code.
@ghost
Copy link

ghost commented Nov 21, 2020

CLA assistant check
All CLA requirements met.

@JamesNK JamesNK merged commit 34782d7 into aspnet:master Nov 21, 2020
@kharabasz
Copy link

Is this change available as a NuGet?

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.

3 participants