Skip to content

Commit 245d73a

Browse files
committed
Merge pull request #789 from feross/master
fix "x-forwarded-proto" in node 0.12 and iojs
2 parents 9ece52f + 6d074ef commit 245d73a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/http-proxy/passes/web-incoming.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ web_o = Object.keys(web_o).map(function(pass) {
6464
function XHeaders(req, res, options) {
6565
if(!options.xfwd) return;
6666

67+
var encrypted = req.isSpdy || req.connection.encrypted || req.connection.pair;
6768
var values = {
6869
for : req.connection.remoteAddress || req.socket.remoteAddress,
6970
port : common.getPort(req),
70-
proto: req.isSpdy ? 'https' : (req.connection.pair ? 'https' : 'http')
71+
proto: encrypted ? 'https' : 'http'
7172
};
7273

7374
['for', 'port', 'proto'].forEach(function(header) {

0 commit comments

Comments
 (0)