mirror of
https://github.com/d0zingcat/cors-anywhere.git
synced 2026-05-17 23:16:54 +00:00
Add test for proxy error
This commit is contained in:
@@ -87,6 +87,9 @@ nock('http://example.com')
|
||||
.reply(302, 'redirecting ad infinitum...', {
|
||||
'Location': '/redirectloop'
|
||||
})
|
||||
|
||||
.get('/proxyerror')
|
||||
.replyWithError('throw node')
|
||||
;
|
||||
|
||||
echoheaders('http://example.com');
|
||||
|
||||
@@ -263,6 +263,13 @@ describe('Basic functionality', function() {
|
||||
})
|
||||
.end(done);
|
||||
});
|
||||
|
||||
it('Proxy error', function(done) {
|
||||
request(cors_anywhere)
|
||||
.get('/example.com/proxyerror')
|
||||
.expect('Access-Control-Allow-Origin', '*')
|
||||
.expect(404, 'Not found because of proxy error: Error: throw node', done);
|
||||
});
|
||||
});
|
||||
|
||||
describe('server on https', function() {
|
||||
|
||||
Reference in New Issue
Block a user