mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Merge pull request #789 from feross/master
fix "x-forwarded-proto" in node 0.12 and iojs
This commit is contained in:
commit
245d73ae6c
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user