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: handle bom in text and json #1482

Merged
merged 2 commits into from Mar 11, 2022
Merged

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