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

Check before unmarshaling body #673

Merged
merged 1 commit into from Dec 18, 2019
Merged

Conversation

tejaswiagarwal
Copy link
Contributor

We were not checking that the request body is empty before unmarshaling. Adding a check to prevent request failures.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 69.678% when pulling 2907f0f on unmarshal_body_check into 6f8c029 on master.

@rpatali
Copy link
Contributor

rpatali commented Nov 15, 2019

I don't think this is the right place for the check. We should probably check in your endpoint logic before trying to unmarshal. Imagine a case where body is expected to have a required field but is not present. In such a case, an exception is expected but will be bypassed.

Copy link
Contributor

@argouber argouber left a comment

Choose a reason for hiding this comment

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

Add a test for this too please

@tejaswiagarwal tejaswiagarwal merged commit 2907f0f into master Dec 18, 2019
@ChuntaoLu ChuntaoLu deleted the unmarshal_body_check branch July 8, 2020 17:25
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