heroku-proxy
Advanced tools
Comparing version 1.4.1 to 1.5.0
@@ -51,2 +51,6 @@ 'use strict'; | ||
if (req.get('x-proxy-host')) { | ||
options.hostname = req.get('x-proxy-host'); | ||
} | ||
var proxyReq = require(options.protocol).request({ | ||
@@ -53,0 +57,0 @@ auth : ':' + token, |
{ | ||
"name": "heroku-proxy", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "a heroku proxy", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,2 +20,13 @@ 'use strict'; | ||
it('supports a custom host via x-proxy-host', function(done) { | ||
request({ | ||
url: 'http://localhost:' + clientPort + '/api/apps', | ||
headers: { 'x-proxy-host': '127.0.0.1' } | ||
}, function(err, res) { | ||
if (err) throw err; | ||
res.headers.host.should.eql('127.0.0.1:' + serverPort); | ||
done(); | ||
}); | ||
}); | ||
it('proxies whitelisted headers to and from the API', function(done) { | ||
@@ -22,0 +33,0 @@ request({ |
11230
256