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

feat: Add support for x-www-form-urlencoded requests to rv.ValidateBody #165

Merged
merged 5 commits into from
Jul 8, 2022

Conversation

heyztb
Copy link
Contributor

@heyztb heyztb commented May 21, 2022

Fixes

Fixes #137

This PR adds support for x-www-form-urlencoded requests to the ValidateBody method on the RequestValidator struct.
Previously, only JSON requests would be handled properly.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • [?] I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

This commit adds support for validating incoming webhook requests with
a content-type header of x-www-form-urlencoded. Previously, only
incoming JSON requests were being handled properly.

Added a unit test as well to double check that things are working
correctly.
@heyztb heyztb changed the title feat/fix: Add support for x-www-form-urlencoded requests feat: Add support for x-www-form-urlencoded requests May 21, 2022
@heyztb heyztb changed the title feat: Add support for x-www-form-urlencoded requests feat: Add support for x-www-form-urlencoded requests to rv.ValidateBody May 23, 2022
Copy link
Contributor

@claudiachua claudiachua left a comment

Choose a reason for hiding this comment

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

LGTM

@claudiachua claudiachua merged commit c21e6c4 into twilio:main Jul 8, 2022
claudiachua added a commit that referenced this pull request Jul 8, 2022
claudiachua added a commit that referenced this pull request Jul 8, 2022
@claudiachua
Copy link
Contributor

claudiachua commented Jul 11, 2022

Hi @heyztb , I had to revert this PR as you were trying to merge to main instead of the rc branch. Have included your changes here

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.

The request validator code doesn't work for application/x-www-form-urlencoded POST requests
2 participants