Skip to content

Commit

Permalink
http: do not default to chunked encoding for TRACE
Browse files Browse the repository at this point in the history
Fixes: #25783
  • Loading branch information
lpinca committed May 13, 2019
1 parent 3309c85 commit 9c0adf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ function ClientRequest(input, options, cb) {
method === 'HEAD' ||
method === 'DELETE' ||
method === 'OPTIONS' ||
method === 'TRACE' ||
method === 'CONNECT') {
this.useChunkedEncodingByDefault = false;
} else {
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-http-client-default-headers-exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9c0adf2

Please sign in to comment.