node-fetch
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -8,7 +8,11 @@ | ||
## v1.5.1 (master) | ||
## v1.5.2 (master) | ||
- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent | ||
## v1.5.1 | ||
- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection | ||
## v1.5.0 (master) | ||
## v1.5.0 | ||
@@ -15,0 +19,0 @@ - Enhance: rejected promise now use custom `Error` (thx to @pekeler) |
@@ -77,3 +77,3 @@ | ||
if (!headers.has('connection')) { | ||
if (!headers.has('connection') && !options.agent) { | ||
headers.set('connection', 'close'); | ||
@@ -80,0 +80,0 @@ } |
@@ -59,3 +59,3 @@ | ||
this.counter = init.counter || input.counter || input.follow || 0; | ||
this.agent = init.agent || input.agent || input.agent; | ||
this.agent = init.agent || input.agent; | ||
@@ -62,0 +62,0 @@ Body.call(this, init.body || this._clone(input), { |
{ | ||
"name": "node-fetch", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "A light-weight module that brings window.fetch to node.js and io.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,2 +18,5 @@ | ||
}); | ||
this.server.on('connection', function(socket) { | ||
socket.setTimeout(1500); | ||
}); | ||
} | ||
@@ -20,0 +23,0 @@ |
@@ -953,2 +953,16 @@ | ||
it('should send request with connection keep-alive if agent is provided', function() { | ||
url = base + '/inspect'; | ||
opts = { | ||
agent: new http.Agent({ | ||
keepAlive: true | ||
}) | ||
}; | ||
return fetch(url, opts).then(function(res) { | ||
return res.json(); | ||
}).then(function(res) { | ||
expect(res.headers['connection']).to.equal('keep-alive'); | ||
}); | ||
}); | ||
it('should ignore unsupported attributes while reading headers', function() { | ||
@@ -955,0 +969,0 @@ var FakeHeader = function() {}; |
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
72471
2019
98