Browse Source

http: don't default OPTIONS to chunked encoding

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Fedor Indutny <fedor@indutny.com>
archived-io.js-v0.10
Nick Muerdter 11 years ago
committed by Trevor Norris
parent
commit
1df32af74a
  1. 1
      lib/_http_client.js
  2. 1
      test/simple/test-http-client-default-headers-exist.js

1
lib/_http_client.js

@ -119,6 +119,7 @@ function ClientRequest(options, cb) {
if (method === 'GET' ||
method === 'HEAD' ||
method === 'DELETE' ||
method === 'OPTIONS' ||
method === 'CONNECT') {
self.useChunkedEncodingByDefault = false;
} else {

1
test/simple/test-http-client-default-headers-exist.js

@ -27,6 +27,7 @@ var expectedHeaders = {
'DELETE': ['host', 'connection'],
'GET': ['host', 'connection'],
'HEAD': ['host', 'connection'],
'OPTIONS': ['host', 'connection'],
'POST': ['host', 'connection', 'transfer-encoding'],
'PUT': ['host', 'connection', 'transfer-encoding']
};

Loading…
Cancel
Save