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

fix(fix-request-body): improve content type check #725

Merged
merged 3 commits into from
Mar 13, 2022

Conversation

kevinxh
Copy link
Contributor

@kevinxh kevinxh commented Mar 10, 2022

Description

It is common for POST request to have the content type: application/x-www-form-urlencoded; charset=UTF-8

The charset part can be set when you have a form with attribute accept-charset="utf-8"

I encountered this while using the fixRequestBody function and the content type check doesn't take the charset into account.

Screen Shot 2022-03-09 at 11 57 11 PM

Motivation and Context

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@chimurai
Copy link
Owner

chimurai commented Mar 10, 2022

Hi, thanks for the PR.

Looks like a good improvement.

@coveralls
Copy link

coveralls commented Mar 10, 2022

Coverage Status

Coverage remained the same at 98.86% when pulling 1c5bd04 on kevinxh:fix-request-body-update into e9e25ca on chimurai:master.

@goldcome goldcome mentioned this pull request Mar 11, 2022
2 tasks
@chimurai chimurai changed the title Update fix-request-body content type check fix(fix-request-body): improve content type check Mar 13, 2022
@chimurai chimurai linked an issue Mar 13, 2022 that may be closed by this pull request
2 tasks
@chimurai chimurai merged commit 68bc6d7 into chimurai:master Mar 13, 2022
@chimurai
Copy link
Owner

Thanks for making the PR @kevinxh!

Published fix in v2.0.4

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.

fixRequestBody not work
3 participants