aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/_http_client.js1
-rw-r--r--test/parallel/test-http-client-default-headers-exist.js3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 75c86acf2c..bc2c2af8ac 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -180,6 +180,7 @@ function ClientRequest(input, options, cb) {
method === 'HEAD' ||
method === 'DELETE' ||
method === 'OPTIONS' ||
+ method === 'TRACE' ||
method === 'CONNECT') {
this.useChunkedEncodingByDefault = false;
} else {
diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js
index e0cf82e462..ba4d4fa660 100644
--- a/test/parallel/test-http-client-default-headers-exist.js
+++ b/test/parallel/test-http-client-default-headers-exist.js
@@ -31,7 +31,8 @@ const expectedHeaders = {
'HEAD': ['host', 'connection'],
'OPTIONS': ['host', 'connection'],
'POST': ['host', 'connection', 'content-length'],
- 'PUT': ['host', 'connection', 'content-length']
+ 'PUT': ['host', 'connection', 'content-length'],
+ 'TRACE': ['host', 'connection']
};
const expectedMethods = Object.keys(expectedHeaders);