Skip to content

Commit

Permalink
upgraded node-fetch to 2.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
lquixada committed May 24, 2019
1 parent 92caeaf commit 101bb8c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 32 deletions.
49 changes: 34 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"url": "https://github.com/lquixada/cross-fetch/issues"
},
"dependencies": {
"node-fetch": "2.5.0",
"node-fetch": "2.6.0",
"whatwg-fetch": "3.0.0"
},
"devDependencies": {
Expand Down
18 changes: 10 additions & 8 deletions test/node/webpack/bundle.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35851,11 +35851,9 @@ function clone(instance) {
*
* This function assumes that instance.body is present.
*
* @param Mixed instance Response or Request instance
* @param Mixed instance Any options.body input
*/
function extractContentType(body) {
// istanbul ignore if: Currently, because of a guard in Request, body
// can never be null. Included here for completeness.
if (body === null) {
// body is null
return null;
Expand Down Expand Up @@ -35902,7 +35900,6 @@ function extractContentType(body) {
function getTotalBytes(instance) {
const body = instance.body;

// istanbul ignore if: included for completion

if (body === null) {
// body is null
Expand All @@ -35922,7 +35919,7 @@ function getTotalBytes(instance) {
return null;
} else {
// body is stream
return instance.size || null;
return null;
}
}

Expand Down Expand Up @@ -36371,7 +36368,7 @@ class Response {
}

get url() {
return this[INTERNALS$1].url;
return this[INTERNALS$1].url || '';
}

get status() {
Expand Down Expand Up @@ -36631,7 +36628,12 @@ function getNodeRequestOptions(request) {
headers.set('Accept-Encoding', 'gzip,deflate');
}

if (!headers.has('Connection') && !request.agent) {
let agent = request.agent;
if (typeof agent === 'function') {
agent = agent(parsedURL);
}

if (!headers.has('Connection') && !agent) {
headers.set('Connection', 'close');
}

Expand All @@ -36641,7 +36643,7 @@ function getNodeRequestOptions(request) {
return Object.assign({}, parsedURL, {
method: request.method,
headers: exportNodeCompatibleHeaders(headers),
agent: request.agent
agent
});
}

Expand Down
18 changes: 10 additions & 8 deletions test/node/webpack/bundle.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35860,11 +35860,9 @@ function clone(instance) {
*
* This function assumes that instance.body is present.
*
* @param Mixed instance Response or Request instance
* @param Mixed instance Any options.body input
*/
function extractContentType(body) {
// istanbul ignore if: Currently, because of a guard in Request, body
// can never be null. Included here for completeness.
if (body === null) {
// body is null
return null;
Expand Down Expand Up @@ -35911,7 +35909,6 @@ function extractContentType(body) {
function getTotalBytes(instance) {
const body = instance.body;

// istanbul ignore if: included for completion

if (body === null) {
// body is null
Expand All @@ -35931,7 +35928,7 @@ function getTotalBytes(instance) {
return null;
} else {
// body is stream
return instance.size || null;
return null;
}
}

Expand Down Expand Up @@ -36380,7 +36377,7 @@ class Response {
}

get url() {
return this[INTERNALS$1].url;
return this[INTERNALS$1].url || '';
}

get status() {
Expand Down Expand Up @@ -36640,7 +36637,12 @@ function getNodeRequestOptions(request) {
headers.set('Accept-Encoding', 'gzip,deflate');
}

if (!headers.has('Connection') && !request.agent) {
let agent = request.agent;
if (typeof agent === 'function') {
agent = agent(parsedURL);
}

if (!headers.has('Connection') && !agent) {
headers.set('Connection', 'close');
}

Expand All @@ -36650,7 +36652,7 @@ function getNodeRequestOptions(request) {
return Object.assign({}, parsedURL, {
method: request.method,
headers: exportNodeCompatibleHeaders(headers),
agent: request.agent
agent
});
}

Expand Down

0 comments on commit 101bb8c

Please sign in to comment.