mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-05-13 23:16:51 +00:00
Add more xfwd tests (https+http & http+https)
This commit is contained in:
24
test/test.js
24
test/test.js
@@ -236,6 +236,18 @@ describe('Basic functionality', function() {
|
||||
}, done);
|
||||
});
|
||||
|
||||
it('X-Forwarded-* headers (https)', function(done) {
|
||||
request(cors_anywhere)
|
||||
.get('/https://example.com/echoheaders')
|
||||
.set('test-include-xfwd', '')
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expectJSON({
|
||||
host: 'example.com',
|
||||
'x-forwarded-port': '80',
|
||||
'x-forwarded-proto': 'http',
|
||||
}, done);
|
||||
});
|
||||
|
||||
it('Ignore cookies', function(done) {
|
||||
request(cors_anywhere)
|
||||
.get('/example.com/setcookie')
|
||||
@@ -275,6 +287,18 @@ describe('server on https', function() {
|
||||
stopServer(done);
|
||||
});
|
||||
|
||||
it('X-Forwarded-* headers (http)', function(done) {
|
||||
request(cors_anywhere)
|
||||
.get('/example.com/echoheaders')
|
||||
.set('test-include-xfwd', '')
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expectJSON({
|
||||
host: 'example.com',
|
||||
'x-forwarded-port': '443',
|
||||
'x-forwarded-proto': 'https',
|
||||
}, done);
|
||||
});
|
||||
|
||||
it('X-Forwarded-* headers (https)', function(done) {
|
||||
request(cors_anywhere)
|
||||
.get('/https://example.com/echoheaders')
|
||||
|
||||
Reference in New Issue
Block a user