Skip to content

Commit a255f98

Browse files
committed
[fix] tests
1 parent 16eacfa commit a255f98

File tree

5 files changed

+348
-5
lines changed

5 files changed

+348
-5
lines changed

Diff for: cov/coverage.html

+341
Large diffs are not rendered by default.

Diff for: lib/caronte.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var http = require('http'),
22
https = require('https'),
33
url = require('url'),
4-
caronte = require('./caronte'),
4+
caronte = require('./caronte/'),
55
events = require('eventemitter2'),
66
proxy = exports;
77

@@ -40,6 +40,7 @@ proxy.createProxyServer = function createProxyServer(options) {
4040
}
4141

4242
['target', 'forward'].forEach(function(key) {
43+
if(!options[key]) return;
4344
options[key] = url.parse(options[key]);
4445
});
4546

Diff for: lib/caronte/passes/web.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function deleteLength(req, res, options) {
2626
if(req.method === 'DELETE' && !req.headers['content-length']) {
2727
req.headers['content-length'] = '0';
2828
}
29-
}
29+
},
3030

3131
/**
3232
* Sets timeout in request socket if it was specified in options.
@@ -42,7 +42,7 @@ function timeout(req, res, options) {
4242
if(options.timeout) {
4343
req.socket.setTimeout(options.timeout);
4444
}
45-
}
45+
},
4646

4747
/**
4848
* Sets `x-forwarded-*` headers if specified in config.
@@ -69,7 +69,7 @@ function XHeaders(req, res, options) {
6969
(req.headers['x-forwarded-' + header] ? ',' : '') +
7070
values[header]
7171
});
72-
}
72+
},
7373

7474
/**
7575
* Does the actual proxying. If `forward` is enabled fires up

Diff for: lib/caronte/passes/ws.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// ws

Diff for: lib/caronte/streams/forward.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function ForwardStream() {
4242

4343
ForwardStream.prototype.onPipe = function(request) {
4444
this.forwardReq = (options.ssl ? https : http).request(
45-
common.setupOutgoing(options.ssl || {}, options, request);
45+
common.setupOutgoing(options.ssl || {}, options, request)
4646
);
4747
};
4848

0 commit comments

Comments
 (0)