Skip to content

Commit

Permalink
[fix] write status
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Sep 15, 2013
1 parent 60de543 commit e08d4ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/caronte/index.js
@@ -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');
Expand Down
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions lib/caronte/passes/web-outgoing.js
Expand Up @@ -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;
Expand Down
File renamed without changes.

0 comments on commit e08d4ed

Please sign in to comment.