Skip to content

fix: Properly parse meta tag when parameters are reversed#682

Merged
Richienb merged 4 commits into
node-fetch:masterfrom
techfeed:improve-convertBody-for-http-equiv
Oct 7, 2019
Merged

fix: Properly parse meta tag when parameters are reversed#682
Richienb merged 4 commits into
node-fetch:masterfrom
techfeed:improve-convertBody-for-http-equiv

Conversation

@dsuket

@dsuket dsuket commented Oct 7, 2019

Copy link
Copy Markdown

convertBodyfunction work fine when html has this meta tag.
<meta http-equiv="content-type" content="text/html;charset=shift_jis">

However, if the http-equiv attribute is reversed like this, it will not work.
<meta content="text/html; charset=Shift_JIS" http-equiv="Content-Type" />

@codecov-io

codecov-io commented Oct 7, 2019

Copy link
Copy Markdown

Codecov Report

Merging #682 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #682   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      7           
  Lines         575    579    +4     
  Branches      183    185    +2     
=====================================
+ Hits          575    579    +4
Impacted Files Coverage Δ
src/body.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47a24a0...530a689. Read the comment docs.

@Richienb

Richienb commented Oct 7, 2019

Copy link
Copy Markdown
Member

In v3, we are going to be replacing the regex system with an actual parser in Richienb/fetch-charset-detection/src/index.ts#L53 but we can still use this as a band-aid patch if we do eventually make a final release for v2.

I'm adding some unit tests now.

@dsuket

dsuket commented Oct 7, 2019

Copy link
Copy Markdown
Author

@Richienb Thank you for your reply.
Added test. I'm sorry if it's misplaced.

@Richienb Richienb changed the title fix convertBody for reverse 'http-equiv' fix: Properly parse meta tag when parameters are reversed Oct 7, 2019
@Richienb Richienb merged commit 6a5d192 into node-fetch:master Oct 7, 2019
isaacs added a commit to npm/minipass-fetch that referenced this pull request Oct 18, 2019
This was referenced Mar 17, 2021
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