Skip to content

Commit

Permalink
Change name targetTimeout to proxyTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Rush committed Jun 10, 2014
1 parent 4193d3b commit 7b79a74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/http-proxy/passes/web-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ web_o = Object.keys(web_o).map(function(pass) {

// allow outgoing socket to timeout so that we could
// show an error page at the initial request
if(options.targetTimeout) {
proxyReq.setTimeout(options.targetTimeout, function() {
if(options.proxyTimeout) {
proxyReq.setTimeout(options.proxyTimeout, function() {
proxyReq.abort();
});
}
Expand Down
4 changes: 2 additions & 2 deletions test/lib-http-proxy-passes-web-incoming-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ describe('#createProxyServer.web() using own http server', function () {
}, function() {}).end();
});

it('should proxy the request and handle timeout error (targetTimeout)', function(done) {
it('should proxy the request and handle timeout error (proxyTimeout)', function(done) {
var proxy = httpProxy.createProxyServer({
target: 'https://127.0.0.1:45000',
targetTimeout: 100
proxyTimeout: 100
});

require('net').createServer().listen(45000);
Expand Down

0 comments on commit 7b79a74

Please sign in to comment.