Actualizacion de seguridad
This commit is contained in:
11
node_modules/node-fetch/lib/index.es.js
generated
vendored
11
node_modules/node-fetch/lib/index.es.js
generated
vendored
@@ -1361,10 +1361,6 @@ function getNodeRequestOptions(request) {
|
||||
agent = agent(parsedURL);
|
||||
}
|
||||
|
||||
if (!headers.has('Connection') && !agent) {
|
||||
headers.set('Connection', 'close');
|
||||
}
|
||||
|
||||
// HTTP-network fetch step 4.2
|
||||
// chunked encoding is handled by Node.js
|
||||
|
||||
@@ -1738,8 +1734,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
||||
|
||||
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
||||
response.once('close', function (hadError) {
|
||||
// tests for socket presence, as in some situations the
|
||||
// the 'socket' event is not triggered for the request
|
||||
// (happens in deno), avoids `TypeError`
|
||||
// if a data listener is still present we didn't end cleanly
|
||||
const hasDataListener = socket.listenerCount('data') > 0;
|
||||
const hasDataListener = socket && socket.listenerCount('data') > 0;
|
||||
|
||||
if (hasDataListener && !hadError) {
|
||||
const err = new Error('Premature close');
|
||||
@@ -1775,4 +1774,4 @@ fetch.isRedirect = function (code) {
|
||||
fetch.Promise = global.Promise;
|
||||
|
||||
export default fetch;
|
||||
export { Headers, Request, Response, FetchError };
|
||||
export { Headers, Request, Response, FetchError, AbortError };
|
||||
|
||||
Reference in New Issue
Block a user