Skip to content

Commit

Permalink
[fix] tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Aug 9, 2013
1 parent 16eacfa commit a255f98
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 5 deletions.
341 changes: 341 additions & 0 deletions cov/coverage.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/caronte.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var http = require('http'),
https = require('https'),
url = require('url'),
caronte = require('./caronte'),
caronte = require('./caronte/'),
events = require('eventemitter2'),
proxy = exports;

Expand Down Expand Up @@ -40,6 +40,7 @@ proxy.createProxyServer = function createProxyServer(options) {
}

['target', 'forward'].forEach(function(key) {
if(!options[key]) return;
options[key] = url.parse(options[key]);
});

Expand Down
6 changes: 3 additions & 3 deletions lib/caronte/passes/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function deleteLength(req, res, options) {
if(req.method === 'DELETE' && !req.headers['content-length']) {
req.headers['content-length'] = '0';
}
}
},

/**
* Sets timeout in request socket if it was specified in options.
Expand All @@ -42,7 +42,7 @@ function timeout(req, res, options) {
if(options.timeout) {
req.socket.setTimeout(options.timeout);
}
}
},

/**
* Sets `x-forwarded-*` headers if specified in config.
Expand All @@ -69,7 +69,7 @@ function XHeaders(req, res, options) {
(req.headers['x-forwarded-' + header] ? ',' : '') +
values[header]
});
}
},

/**
* Does the actual proxying. If `forward` is enabled fires up
Expand Down
1 change: 1 addition & 0 deletions lib/caronte/passes/ws.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// ws
2 changes: 1 addition & 1 deletion lib/caronte/streams/forward.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function ForwardStream() {

ForwardStream.prototype.onPipe = function(request) {
this.forwardReq = (options.ssl ? https : http).request(
common.setupOutgoing(options.ssl || {}, options, request);
common.setupOutgoing(options.ssl || {}, options, request)
);
};

Expand Down

0 comments on commit a255f98

Please sign in to comment.