Skip to content

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

Merged
chimurai merged 3 commits intochimurai:masterfrom
kevinxh:fix-request-body-update
Mar 13, 2022
Merged

fix(fix-request-body): improve content type check#725
chimurai merged 3 commits intochimurai:masterfrom
kevinxh:fix-request-body-update

Conversation

@kevinxh
Copy link
Copy Markdown
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
Copy Markdown
Owner

chimurai commented Mar 10, 2022

Hi, thanks for the PR.

Looks like a good improvement.

@coveralls
Copy link
Copy Markdown

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
Copy Markdown
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