node-fetch
Advanced tools
Comparing version 3.2.4 to 3.2.5
{ | ||
"name": "node-fetch", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"description": "A light-weight module that brings Fetch API to node.js", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -431,3 +431,3 @@ <div align="center"> | ||
const binary = new Uint8Array([ 97, 98, 99 ]) | ||
const abc = new File([binary], 'abc.txt'), { type: 'text/plain' }) | ||
const abc = new File([binary], 'abc.txt', { type: 'text/plain' }) | ||
@@ -541,3 +541,3 @@ formData.set('greeting', 'Hello, world!') | ||
| ------------------- | ------------------------------------------------------ | | ||
| `Accept-Encoding` | `gzip,deflate,br` _(when `options.compress === true`)_ | | ||
| `Accept-Encoding` | `gzip, deflate, br` (when `options.compress === true`) | | ||
| `Accept` | `*/*` | | ||
@@ -599,3 +599,3 @@ | `Connection` | `close` _(when no `options.agent` is present)_ | | ||
const response = await fetch('https://example.com'); | ||
const r1 = await response.clone(); | ||
const r1 = response.clone(); | ||
@@ -602,0 +602,0 @@ const results = await Promise.all([response.json(), r1.text()]); |
@@ -390,9 +390,3 @@ /** | ||
socket.prependListener('close', onSocketClose); | ||
request.on('abort', () => { | ||
socket.removeListener('close', onSocketClose); | ||
}); | ||
socket.on('data', buf => { | ||
const onData = buf => { | ||
properLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0; | ||
@@ -409,4 +403,12 @@ | ||
previousChunk = buf; | ||
}; | ||
socket.prependListener('close', onSocketClose); | ||
socket.on('data', onData); | ||
request.on('close', () => { | ||
socket.removeListener('close', onSocketClose); | ||
socket.removeListener('data', onData); | ||
}); | ||
}); | ||
} |
@@ -283,3 +283,3 @@ /** | ||
if (request.compress && !headers.has('Accept-Encoding')) { | ||
headers.set('Accept-Encoding', 'gzip,deflate,br'); | ||
headers.set('Accept-Encoding', 'gzip, deflate, br'); | ||
} | ||
@@ -286,0 +286,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105945
2289