When used in the browser, got sets two headers in its requests, without a possibility to remove them:
Access-Control-Request-Method: GET
Access-Control-Request-Headers: user-agent
These headers were making requests fail on Firefox, on servers that do not set "user-agent" explicitly in the allowed CORS headers (specifically gateway.ipfs.io).
Another reason for the move is that got is using several Node.js modules that are expected to be polyfilled by the bundler, which can result in an excessively large bundle size (169.113K with got, 16.103K with axios).
API change: the getFileStream() method now returns a promise that resolves to a stream, rather than a stream directly.
When used in the browser, got sets two headers in its requests, without a possibility to remove them:
These headers were making requests fail on Firefox, on servers that do not set "user-agent" explicitly in the allowed CORS headers (specifically
gateway.ipfs.io
).Another reason for the move is that got is using several Node.js modules that are expected to be polyfilled by the bundler, which can result in an excessively large bundle size (169.113K with got, 16.103K with axios).
API change: the
getFileStream()
method now returns a promise that resolves to a stream, rather than a stream directly.