Skip to content

Commit bfb9356

Browse files
lpincatargos
authored andcommitted
http: do not default to chunked encoding for TRACE
Fixes: #25783 PR-URL: #27673 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 83f2430 commit bfb9356

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/_http_client.js

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ function ClientRequest(input, options, cb) {
180180
method === 'HEAD' ||
181181
method === 'DELETE' ||
182182
method === 'OPTIONS' ||
183+
method === 'TRACE' ||
183184
method === 'CONNECT') {
184185
this.useChunkedEncodingByDefault = false;
185186
} else {

test/parallel/test-http-client-default-headers-exist.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const expectedHeaders = {
3131
'HEAD': ['host', 'connection'],
3232
'OPTIONS': ['host', 'connection'],
3333
'POST': ['host', 'connection', 'content-length'],
34-
'PUT': ['host', 'connection', 'content-length']
34+
'PUT': ['host', 'connection', 'content-length'],
35+
'TRACE': ['host', 'connection']
3536
};
3637

3738
const expectedMethods = Object.keys(expectedHeaders);

0 commit comments

Comments
 (0)