lquixada / cross-fetch

Universal WHATWG Fetch API for Node, Browsers and React Native.
MIT License
1.67k stars 104 forks source link

Version 3.0.3 buffer issue #50

Closed Eth-a-n closed 5 years ago

Eth-a-n commented 5 years ago

In the latest version of the package (3.0.3) instead of a JSON response you get a buffer

{"data": [123, 34, 116, 111, 107, 101, 110, 34, 58, 34, 54, 102, 54, 56, 51, 50, 51, 49, 45, 48, 98, 48, 52, 45, 52, 102, 48, 55, 45, 97, 51, 51, 55], "type": "Buffer"}

VilmaRamos commented 5 years ago

This is related with the upgrade to node-fetch latest version. Since version node-fetch@2.4.0, body will be buffered if it's a string. See this PR

Eth-a-n commented 5 years ago

This probably should have been marked as a breaking change !

lquixada commented 5 years ago

Hi @ethan-pearce! Thanks for reporting the issue. Can you provide a snippet of your code that broke because of this change?

lquixada commented 5 years ago

Closing this issue since there was no response.