Skip to content

Commit e08d4ed

Browse files
committed
[fix] write status
1 parent 60de543 commit e08d4ed

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

lib/caronte/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var caronte = exports,
2-
web = require('./passes/web');
3-
ws = require('./passes/ws');
2+
web = require('./passes/web-incoming');
3+
ws = require('./passes/ws-incoming');
44

55
caronte.createWebProxy = createRightProxy('web');
66
caronte.createWsProxy = createRightProxy('ws');

lib/caronte/passes/web.js renamed to lib/caronte/passes/web-incoming.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function XHeaders(req, res, options) {
9191

9292
function stream(req, res, options) {
9393
if(options.forward) {
94-
var forwardReq = (options.target.protocol === 'https:' ? https : http).request(
94+
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
9595
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
9696
);
9797
req.pipe(forwardReq);

lib/caronte/passes/web-outgoing.js

+6
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ var passes = exports;
99
*/
1010

1111
[ // <--
12+
13+
function writeStatusCode(res, proxyRes) {
14+
res.writeHead(proxyRes.statusCode);
15+
},
16+
1217
function writeHeaders(res, proxyRes) {
1318
Object.keys(proxyRes.headers).forEach(function(key) {
1419
res.setHeader(key, proxyRes.headers[key]);
1520
});
1621
}
22+
1723
] // <--
1824
.forEach(function(func) {
1925
passes[func.name] = func;
File renamed without changes.

0 commit comments

Comments
 (0)