mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] write status
This commit is contained in:
parent
60de543d04
commit
e08d4edad3
@ -1,6 +1,6 @@
|
||||
var caronte = exports,
|
||||
web = require('./passes/web');
|
||||
ws = require('./passes/ws');
|
||||
web = require('./passes/web-incoming');
|
||||
ws = require('./passes/ws-incoming');
|
||||
|
||||
caronte.createWebProxy = createRightProxy('web');
|
||||
caronte.createWsProxy = createRightProxy('ws');
|
||||
|
||||
@ -91,7 +91,7 @@ function XHeaders(req, res, options) {
|
||||
|
||||
function stream(req, res, options) {
|
||||
if(options.forward) {
|
||||
var forwardReq = (options.target.protocol === 'https:' ? https : http).request(
|
||||
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
|
||||
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
|
||||
);
|
||||
req.pipe(forwardReq);
|
||||
@ -9,11 +9,17 @@ var passes = exports;
|
||||
*/
|
||||
|
||||
[ // <--
|
||||
|
||||
function writeStatusCode(res, proxyRes) {
|
||||
res.writeHead(proxyRes.statusCode);
|
||||
},
|
||||
|
||||
function writeHeaders(res, proxyRes) {
|
||||
Object.keys(proxyRes.headers).forEach(function(key) {
|
||||
res.setHeader(key, proxyRes.headers[key]);
|
||||
});
|
||||
}
|
||||
|
||||
] // <--
|
||||
.forEach(function(func) {
|
||||
passes[func.name] = func;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user