mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
http2: rename variable to additionalPseudoHeaders
PR-URL: https://github.com/nodejs/node/pull/60208 Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
This commit is contained in:
parent
822a8c3244
commit
5cf3c3e24c
|
|
@ -624,7 +624,7 @@ function prepareRequestHeadersArray(headers, session) {
|
|||
let path;
|
||||
let protocol;
|
||||
|
||||
// Extract the key psuedo header values from the headers array
|
||||
// Extract the key pseudo header values from the headers array.
|
||||
for (let i = 0; i < headers.length; i += 2) {
|
||||
if (headers[i][0] !== ':') {
|
||||
continue;
|
||||
|
|
@ -648,11 +648,11 @@ function prepareRequestHeadersArray(headers, session) {
|
|||
|
||||
// We then build an array of any missing pseudo headers, to prepend
|
||||
// default values to the given header array:
|
||||
const additionalPsuedoHeaders = [];
|
||||
const additionalPseudoHeaders = [];
|
||||
|
||||
if (method === undefined) {
|
||||
method = HTTP2_METHOD_GET;
|
||||
additionalPsuedoHeaders.push(HTTP2_HEADER_METHOD, method);
|
||||
additionalPseudoHeaders.push(HTTP2_HEADER_METHOD, method);
|
||||
}
|
||||
|
||||
const connect = method === HTTP2_METHOD_CONNECT;
|
||||
|
|
@ -660,14 +660,14 @@ function prepareRequestHeadersArray(headers, session) {
|
|||
if (!connect || protocol !== undefined) {
|
||||
if (authority === undefined && headers[HTTP2_HEADER_HOST] === undefined) {
|
||||
authority = session[kAuthority];
|
||||
additionalPsuedoHeaders.push(HTTP2_HEADER_AUTHORITY, authority);
|
||||
additionalPseudoHeaders.push(HTTP2_HEADER_AUTHORITY, authority);
|
||||
}
|
||||
if (scheme === undefined) {
|
||||
scheme = session[kProtocol].slice(0, -1);
|
||||
additionalPsuedoHeaders.push(HTTP2_HEADER_SCHEME, scheme);
|
||||
additionalPseudoHeaders.push(HTTP2_HEADER_SCHEME, scheme);
|
||||
}
|
||||
if (path === undefined) {
|
||||
additionalPsuedoHeaders.push(HTTP2_HEADER_PATH, '/');
|
||||
additionalPseudoHeaders.push(HTTP2_HEADER_PATH, '/');
|
||||
}
|
||||
} else {
|
||||
if (authority === undefined)
|
||||
|
|
@ -679,8 +679,8 @@ function prepareRequestHeadersArray(headers, session) {
|
|||
}
|
||||
|
||||
const rawHeaders =
|
||||
additionalPsuedoHeaders.length ?
|
||||
additionalPsuedoHeaders.concat(headers) :
|
||||
additionalPseudoHeaders.length ?
|
||||
additionalPseudoHeaders.concat(headers) :
|
||||
headers;
|
||||
|
||||
if (headers[kSensitiveHeaders] !== undefined) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user