Merge pull request #789 from feross/master

fix "x-forwarded-proto" in node 0.12 and iojs
This commit is contained in:
Jarrett Cruger 2015-03-11 21:07:38 -04:00
commit 245d73ae6c

View File

@ -64,10 +64,11 @@ web_o = Object.keys(web_o).map(function(pass) {
function XHeaders(req, res, options) {
if(!options.xfwd) return;
var encrypted = req.isSpdy || req.connection.encrypted || req.connection.pair;
var values = {
for : req.connection.remoteAddress || req.socket.remoteAddress,
port : common.getPort(req),
proto: req.isSpdy ? 'https' : (req.connection.pair ? 'https' : 'http')
proto: encrypted ? 'https' : 'http'
};
['for', 'port', 'proto'].forEach(function(header) {