Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set x-forwarded-proto correctly, all tests pass

  • Loading branch information...
commit 18c1a9072f016d99b34b6cad491d7b6d32193a41 1 parent 136f90b
@substack authored
Showing with 3 additions and 4 deletions.
  1. +2 −1  index.js
  2. +1 −1  package.json
  3. +0 −2  test/https.js
View
3  index.js
@@ -66,7 +66,8 @@ var handler = bouncy.handler = function (cb, c) {
opts.headers['x-forwarded-port'] = m && m[1] || 80;
}
if (!opts.headers.hasOwnProperty('x-forwarded-proto')) {
- opts.headers['x-forwarded-proto'] = 'http';
+ opts.headers['x-forwarded-proto'] =
+ c.encrypted ? 'https' : 'http';
}
}
View
2  package.json
@@ -1,7 +1,7 @@
{
"name" : "bouncy",
"description" : "Bounce HTTP requests around for a load balancer or http host router completely transparently",
- "version" : "0.2.1",
+ "version" : "0.3.0",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/bouncy.git"
View
2  test/https.js
@@ -38,7 +38,6 @@ test('https', function (t) {
};
https.get(opts, function (res) {
-console.log('get!');
t.equal(res.statusCode, 200)
t.equal(res.headers['content-type'], 'text/plain');
@@ -49,7 +48,6 @@ console.log('get!');
res.on('end', function () {
t.equal(data, 'beep boop');
-console.log('POW!');
s0.close();
s1.close();
t.end();
Please sign in to comment.
Something went wrong with that request. Please try again.