Commit Graph

11 Commits

Author SHA1 Message Date
Rob Wu
a9e06a9dab Reject invalid redirects
Fixes #234.
2020-05-06 23:25:17 +02:00
Rob Wu
70400ab166 Monkey-patch nock, add Node v8 to test matrix 2017-07-13 18:58:29 +02:00
Rob Wu
e6695b8102 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
2016-03-19 18:35:17 +01:00
Rob Wu
1308e34247 More test coverage for redirects 2016-02-26 16:10:53 +01:00
Rob Wu
0872577729 Enforce a consistent coding style using eslint 2016-02-26 12:31:35 +01:00
Rob Wu
bbe3378c35 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.
2016-02-19 00:39:17 +01:00
Rob Wu
8568c06b17 Support proxying through a proxy - #37
Automatically respects proxy headers from environment variables,
using https://github.com/Rob--W/proxy-from-env
2016-02-19 00:22:20 +01:00
Rob Wu
0e594a2b03 Skip host check if scheme is explicitly set
Fixes https://github.com/Rob--W/cors-anywhere/issues/14

This allows CORS anywhere to be forwards-compatible with the surge
of new gTLDs.
2015-05-09 11:09:59 +02:00
Rob Wu
d437bc9225 Test that redirect headers are not set in response 2015-05-06 20:02:55 +02:00
Rob Wu
f98705f27b Add test for proxy error 2015-05-06 18:40:04 +02:00
Rob Wu
1ee157fc0f Add unit tests 2015-05-05 22:37:20 +02:00