mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-06-09 07:26:54 +00:00
Tests: Replace space with dash in header name
Node.js has forbidden header names with spaces in
6192c9892f.
The next error is thrown when the test sets the "some header" header:
Uncaught TypeError: Header name must be a valid HTTP Token ["some header"]
To fix it, replace spaces with dashes.
This commit is contained in:
@@ -142,11 +142,11 @@ describe('Basic functionality', function() {
|
||||
.head('/example.com/redirect')
|
||||
.redirects(0)
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expect('some header', 'value')
|
||||
.expect('some-header', 'value')
|
||||
.expect('x-request-url', 'http://example.com/redirect')
|
||||
.expect('x-cors-redirect-1', '302 http://example.com/redirecttarget')
|
||||
.expect('x-final-url', 'http://example.com/redirecttarget')
|
||||
.expect('access-control-expose-headers', /some header,x-final-url/)
|
||||
.expect('access-control-expose-headers', /some-header,x-final-url/)
|
||||
.expectNoHeader('header at redirect')
|
||||
.expect(200, '', done);
|
||||
});
|
||||
@@ -156,11 +156,11 @@ describe('Basic functionality', function() {
|
||||
.get('/example.com/redirect')
|
||||
.redirects(0)
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expect('some header', 'value')
|
||||
.expect('some-header', 'value')
|
||||
.expect('x-request-url', 'http://example.com/redirect')
|
||||
.expect('x-cors-redirect-1', '302 http://example.com/redirecttarget')
|
||||
.expect('x-final-url', 'http://example.com/redirecttarget')
|
||||
.expect('access-control-expose-headers', /some header,x-final-url/)
|
||||
.expect('access-control-expose-headers', /some-header,x-final-url/)
|
||||
.expectNoHeader('header at redirect')
|
||||
.expect(200, 'redirect target', done);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user