Actualizacion de seguridad
This commit is contained in:
10
node_modules/node-fetch/lib/index.js
generated
vendored
10
node_modules/node-fetch/lib/index.js
generated
vendored
@@ -1365,10 +1365,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
|
||||
|
||||
@@ -1742,8 +1738,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');
|
||||
@@ -1785,3 +1784,4 @@ exports.Headers = Headers;
|
||||
exports.Request = Request;
|
||||
exports.Response = Response;
|
||||
exports.FetchError = FetchError;
|
||||
exports.AbortError = AbortError;
|
||||
|
||||
Reference in New Issue
Block a user