Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Commit 7ecff39

Browse files
committed
Update follow-redirects.
The 1.0.0 version add supports for multiple agents, which are necessary for cross-protocol redirects.
1 parent a2009db commit 7ecff39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/util/Request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var EventEmitter = require('events').EventEmitter,
1111
// Try to keep connections open, and set a maximum number of connections per server
1212
var AGENT_SETTINGS = { keepAlive: true, maxSockets: 5 };
1313
var AGENTS = {
14-
'http:': new http.Agent(AGENT_SETTINGS),
15-
'https:': new https.Agent(AGENT_SETTINGS),
14+
http: new http.Agent(AGENT_SETTINGS),
15+
https: new https.Agent(AGENT_SETTINGS),
1616
};
1717

1818
// Decode encoded streams with these decoders
@@ -27,7 +27,7 @@ function createRequest(settings) {
2727
// Emit the response through a proxy
2828
var request, requestProxy = new EventEmitter(),
2929
requester = settings.protocol === 'http:' ? http : https;
30-
settings.agent = AGENTS[settings.protocol];
30+
settings.agents = AGENTS;
3131
request = requester.request(settings, function (response) {
3232
response = decode(response);
3333
response.setEncoding('utf8');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"dependencies": {
2727
"asynciterator": "^1.1.0",
28-
"follow-redirects": "^0.3.0",
28+
"follow-redirects": "^1.0.0",
2929
"lodash": "~2.4.1",
3030
"lru-cache": "^4.0.1",
3131
"minimist": "^1.2.0",

0 commit comments

Comments
 (0)