Skip to content

fix: handle bom in text and json#1482

Merged
jimmywarting merged 2 commits intonode-fetch:mainfrom
jimmywarting:bom
Mar 11, 2022
Merged

fix: handle bom in text and json#1482
jimmywarting merged 2 commits intonode-fetch:mainfrom
jimmywarting:bom

Conversation

@jimmywarting
Copy link
Collaborator

@jimmywarting jimmywarting commented Jan 25, 2022

Purpose

long over due problem to an easy fix... .text() & .json() didn't handle BOM correctly

Changes

switch buffer.toString() to TextDecoder().decode()


  • I added unit test(s)

Copy link
Member

@LinusU LinusU left a comment

Choose a reason for hiding this comment

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

Nice! 👍

@jimmywarting jimmywarting merged commit 6425e20 into node-fetch:main Mar 11, 2022
@jimmywarting jimmywarting deleted the bom branch March 11, 2022 21:49
@github-actions
Copy link

🎉 This PR is included in version 3.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling a BOM with .json()

3 participants