From 1df32af74a450d456e264afbbaf6201a388d7572 Mon Sep 17 00:00:00 2001 From: Nick Muerdter Date: Tue, 3 Jun 2014 21:49:38 -0600 Subject: [PATCH] http: don't default OPTIONS to chunked encoding Signed-off-by: Trevor Norris Signed-off-by: Fedor Indutny --- lib/_http_client.js | 1 + test/simple/test-http-client-default-headers-exist.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/_http_client.js b/lib/_http_client.js index e259beef23..0c0dc51688 100644 --- a/lib/_http_client.js +++ b/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 { diff --git a/test/simple/test-http-client-default-headers-exist.js b/test/simple/test-http-client-default-headers-exist.js index c2274170f3..24470b95da 100644 --- a/test/simple/test-http-client-default-headers-exist.js +++ b/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'] };