mirror of
https://github.com/http-party/node-http-proxy.git
synced 2026-02-01 17:46:18 +00:00
[test] passes/web.js XHeaders func
This commit is contained in:
parent
d40e4beb62
commit
c02b721321
@ -25,4 +25,21 @@ describe('lib/caronte/passes/web.js', function() {
|
|||||||
expect(done).to.eql(5000);
|
expect(done).to.eql(5000);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('#XHeaders', function () {
|
||||||
|
var stubRequest = {
|
||||||
|
connection: {
|
||||||
|
remoteAddress: '192.168.1.2',
|
||||||
|
remotePort: '8080'
|
||||||
|
},
|
||||||
|
headers: {}
|
||||||
|
}
|
||||||
|
|
||||||
|
it('set the correct x-forwarded-* headers', function () {
|
||||||
|
caronte.XHeaders(stubRequest, {}, { xfwd: true });
|
||||||
|
expect(stubRequest.headers['x-forwarded-for']).to.be('192.168.1.2');
|
||||||
|
expect(stubRequest.headers['x-forwarded-port']).to.be('8080');
|
||||||
|
expect(stubRequest.headers['x-forwarded-proto']).to.be('http');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user