Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: set isLowerCase param on all calls of HeadersList.append #3468

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web/cookies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function setCookie (headers, cookie) {
const str = stringify(cookie)

if (str) {
headers.append('Set-Cookie', str)
headers.append('set-cookie', str, true)
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/web/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ async function httpNetworkOrCacheFetch (
// user agents should append `User-Agent`/default `User-Agent` value to
// httpRequest’s header list.
if (!httpRequest.headersList.contains('user-agent', true)) {
httpRequest.headersList.append('user-agent', defaultUserAgent)
httpRequest.headersList.append('user-agent', defaultUserAgent, true)
}

// 15. If httpRequest’s cache mode is "default" and httpRequest’s header
Expand Down
2 changes: 1 addition & 1 deletion lib/web/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ class Request {
// not contain `Content-Type`, then append `Content-Type`/Content-Type to
// this’s headers.
if (contentType && !getHeadersList(this[kHeaders]).contains('content-type', true)) {
this[kHeaders].append('content-type', contentType)
this[kHeaders].append('content-type', contentType, true)
}
}

Expand Down
10 changes: 5 additions & 5 deletions lib/web/websocket/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ try {
* @param {URL} url
* @param {string|string[]} protocols
* @param {import('./websocket').Handler} handler
* @param {Partial<import('../../types/websocket').WebSocketInit>} options
* @param {Partial<import('../../../types/websocket').WebSocketInit>} options
*/
function establishWebSocketConnection (url, protocols, client, handler, options) {
// 1. Let requestURL be a copy of url, with its scheme set to "http", if url’s
Expand Down Expand Up @@ -65,17 +65,17 @@ function establishWebSocketConnection (url, protocols, client, handler, options)

// 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s
// header list.
request.headersList.append('sec-websocket-key', keyValue)
request.headersList.append('sec-websocket-key', keyValue, true)

// 7. Append (`Sec-WebSocket-Version`, `13`) to request’s
// header list.
request.headersList.append('sec-websocket-version', '13')
request.headersList.append('sec-websocket-version', '13', true)

// 8. For each protocol in protocols, combine
// (`Sec-WebSocket-Protocol`, protocol) in request’s header
// list.
for (const protocol of protocols) {
request.headersList.append('sec-websocket-protocol', protocol)
request.headersList.append('sec-websocket-protocol', protocol, true)
}

// 9. Let permessageDeflate be a user-agent defined
Expand All @@ -85,7 +85,7 @@ function establishWebSocketConnection (url, protocols, client, handler, options)

// 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to
// request’s header list.
request.headersList.append('sec-websocket-extensions', permessageDeflate)
request.headersList.append('sec-websocket-extensions', permessageDeflate, true)

// 11. Fetch request with useParallelQueue set to true, and
// processResponse given response being these steps:
Expand Down
Loading