Add redirectSameOrigin

Some clients try to use CORS Anywhere, even for same-origin requests...
Add a new setting "redirectSameOrigin" to not waste server resources on
proxying such requests.

Fixes #42
This commit is contained in:
Rob Wu
2016-03-19 18:22:29 +01:00
parent bacbbe0cb0
commit e6695b8102
5 changed files with 109 additions and 0 deletions

View File

@@ -102,6 +102,24 @@ nock('https://example.com')
.reply(200, 'Response from https://example.com')
;
nock('http://example.com.com')
.persist()
.get('/')
.reply(200, 'Response from example.com.com')
;
nock('http://example.com:1234')
.persist()
.get('/')
.reply(200, 'Response from example.com:1234')
;
nock('http://prefix.example.com')
.persist()
.get('/')
.reply(200, 'Response from prefix.example.com')
;
echoheaders('http://example.com');
echoheaders('http://example.com:1337');
echoheaders('https://example.com');