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

upgrade fetch-blob #1800

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node: ["12.20.0", "14.13.1", "16.0.0"]
node: ["12.20.0", "14.13.1", "16.0.0", "18.18.2", "20.11.0", "21.5.0"]
exclude:
# On Windows, run tests with only the LTS environments.
- os: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"fetch-blob": "^4.0.0",
"formdata-polyfill": "^4.0.10"
},
"tsd": {
Expand Down
2 changes: 1 addition & 1 deletion src/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Stream, {PassThrough} from 'node:stream';
import {types, deprecate, promisify} from 'node:util';
import {Buffer} from 'node:buffer';

import Blob from 'fetch-blob';
import { Blob } from 'fetch-blob';
import {FormData, formDataToBlob} from 'formdata-polyfill/esm.min.js';

import {FetchError} from './errors/fetch-error.js';
Expand Down
3 changes: 2 additions & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2183,7 +2183,8 @@ describe('node-fetch', () => {
function lookupSpy(hostname, options, callback) {
families.push(options.family);

return lookup(hostname, {}, callback);
const cb = process.version.startsWith('v2') ? (err, address, family) => callback(err, [{address, family}]) : callback;
return lookup(hostname, {}, cb);
}

const agent = new http.Agent({lookup: lookupSpy, family});
Expand Down
2 changes: 1 addition & 1 deletion test/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import http from 'node:http';
import AbortController from 'abort-controller';
import chai from 'chai';
import FormData from 'form-data';
import Blob from 'fetch-blob';
import { Blob } from 'fetch-blob';

import {Request} from '../src/index.js';
import TestServer from './utils/server.js';
Expand Down
2 changes: 1 addition & 1 deletion test/utils/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default class TestServer {

if (p === '/chunked/multiple-ending') {
res.socket.write('HTTP/1.1 200\r\nTransfer-Encoding: chunked\r\n\r\n');
res.socket.write('3\r\nfoo\r\n3\r\nbar\r\n0\r\n\r\n');
res.socket.end('3\r\nfoo\r\n3\r\nbar\r\n0\r\n\r\n');
}

if (p === '/error/json') {
Expand Down