http: do not default to chunked encoding for TRACE
Fixes: https://github.com/nodejs/node/issues/25783 PR-URL: https://github.com/nodejs/node/pull/27673 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
6f7e8b4521
commit
4fc0238a66
@ -180,6 +180,7 @@ function ClientRequest(input, options, cb) {
|
||||
method === 'HEAD' ||
|
||||
method === 'DELETE' ||
|
||||
method === 'OPTIONS' ||
|
||||
method === 'TRACE' ||
|
||||
method === 'CONNECT') {
|
||||
this.useChunkedEncodingByDefault = false;
|
||||
} else {
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user