11 Commits

Author SHA1 Message Date
Mike Pennisi
8a24a1e18f Set Content-Length header for OPTIONS requests
Web browsers automatically issue an OPTIONS request in advance of other
HTTP requests when the document's domain does not match the target in
order to facilitate Cross-Origin Resource Sharing. These requests are
forbidden from specifying a body and typically do not specify an
(unecessary) `Length` header.

Node.js automatically adds the `Content-Encoding: chunked` header value
to requests that do not specify a `Length` header. This makes proxied
OPTIONS requests from web browsers invalid.

Explicitly set the `Content-Length` header of all `OPTIONS` requests to
"0", disabling the default "chunked" encoding behavior [2].

[1] http://www.w3.org/TR/cors/
[2] http://nodejs.org/api/http.html
2014-11-24 17:14:48 -05:00
Alex Oshchepkov
796ab0bcc5 Added changeOrigin option with test and docs 2014-10-29 07:25:19 +05:00
Manu Sporny
db5f2954b2 [api] Add event-based ability to modify pre-flight proxy requests. 2014-07-18 11:46:04 -04:00
Damian Kaczmarek
7b79a7409a Change name targetTimeout to proxyTimeout 2014-06-10 19:04:12 +02:00
Damian Kaczmarek
0f243516e1 Added targetTimeout option and two tests for timeout 2014-06-10 01:35:53 +02:00
Bryce Gibson
1385635e18 Add a test for the proxyRes event 2014-05-12 08:44:02 +10:00
cronopio
cfd417de23 [tests] fix tests set correct host headers 2013-12-18 12:17:41 -05:00
cronopio
7c72f3b407 [tests] move contributions of @mmoulton to correct place 2013-10-21 21:11:19 -05:00
cronopio
2bf20d61d5 Revert "[tests] fix test to use the new way to pass options"
This reverts commit 52ecd52ee5aa78603e44ba8d5ff9187410351622.
2013-10-21 14:44:49 -05:00
cronopio
52ecd52ee5 [tests] fix test to use the new way to pass options 2013-10-21 03:59:14 -05:00
cronopio
c9f5772fc1 [tests] remove caronte and use http-proxy for file names 2013-10-09 10:49:13 -05:00