Merge pull request #266 from rampr/master

Fix bug: x-forwarded-proto set incorrectly as httphttps or wswss
This commit is contained in:
Joshua Holbrook 2012-06-18 23:42:50 -07:00
commit ccd8f840b2

View File

@ -148,7 +148,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
}
if (req.headers['x-forwarded-proto']){
var protoToAppend = "," + (req.connection.pair) ? 'https' : 'http';
var protoToAppend = "," + (req.connection.pair ? 'https' : 'http');
req.headers['x-forwarded-proto'] += protoToAppend;
}
else {
@ -415,7 +415,7 @@ HttpProxy.prototype.proxyWebSocketRequest = function (req, socket, head, buffer)
}
if (req.headers['x-forwarded-proto']){
var protoToAppend = "," + (req.connection.pair) ? 'wss' : 'ws';
var protoToAppend = "," + (req.connection.pair ? 'wss' : 'ws');
req.headers['x-forwarded-proto'] += protoToAppend;
}
else {