-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:nodejs/undici
# Conflicts: # lib/fetch/index.js
- Loading branch information
Showing
270 changed files
with
4,632 additions
and
1,994 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
/** @type {Record<string, string | undefined>} */ | ||
const headerNameLowerCasedRecord = {} | ||
|
||
// https://developer.mozilla.org/docs/Web/HTTP/Headers | ||
const wellknownHeaderNames = [ | ||
'Accept', | ||
'Accept-Encoding', | ||
'Accept-Language', | ||
'Accept-Ranges', | ||
'Access-Control-Allow-Credentials', | ||
'Access-Control-Allow-Headers', | ||
'Access-Control-Allow-Methods', | ||
'Access-Control-Allow-Origin', | ||
'Access-Control-Expose-Headers', | ||
'Access-Control-Max-Age', | ||
'Access-Control-Request-Headers', | ||
'Access-Control-Request-Method', | ||
'Age', | ||
'Allow', | ||
'Alt-Svc', | ||
'Alt-Used', | ||
'Authorization', | ||
'Cache-Control', | ||
'Clear-Site-Data', | ||
'Connection', | ||
'Content-Disposition', | ||
'Content-Encoding', | ||
'Content-Language', | ||
'Content-Length', | ||
'Content-Location', | ||
'Content-Range', | ||
'Content-Security-Policy', | ||
'Content-Security-Policy-Report-Only', | ||
'Content-Type', | ||
'Cookie', | ||
'Cross-Origin-Embedder-Policy', | ||
'Cross-Origin-Opener-Policy', | ||
'Cross-Origin-Resource-Policy', | ||
'Date', | ||
'Device-Memory', | ||
'Downlink', | ||
'ECT', | ||
'ETag', | ||
'Expect', | ||
'Expect-CT', | ||
'Expires', | ||
'Forwarded', | ||
'From', | ||
'Host', | ||
'If-Match', | ||
'If-Modified-Since', | ||
'If-None-Match', | ||
'If-Range', | ||
'If-Unmodified-Since', | ||
'Keep-Alive', | ||
'Last-Modified', | ||
'Link', | ||
'Location', | ||
'Max-Forwards', | ||
'Origin', | ||
'Permissions-Policy', | ||
'Pragma', | ||
'Proxy-Authenticate', | ||
'Proxy-Authorization', | ||
'RTT', | ||
'Range', | ||
'Referer', | ||
'Referrer-Policy', | ||
'Refresh', | ||
'Retry-After', | ||
'Sec-WebSocket-Accept', | ||
'Sec-WebSocket-Extensions', | ||
'Sec-WebSocket-Key', | ||
'Sec-WebSocket-Protocol', | ||
'Sec-WebSocket-Version', | ||
'Server', | ||
'Server-Timing', | ||
'Service-Worker-Allowed', | ||
'Service-Worker-Navigation-Preload', | ||
'Set-Cookie', | ||
'SourceMap', | ||
'Strict-Transport-Security', | ||
'Supports-Loading-Mode', | ||
'TE', | ||
'Timing-Allow-Origin', | ||
'Trailer', | ||
'Transfer-Encoding', | ||
'Upgrade', | ||
'Upgrade-Insecure-Requests', | ||
'User-Agent', | ||
'Vary', | ||
'Via', | ||
'WWW-Authenticate', | ||
'X-Content-Type-Options', | ||
'X-DNS-Prefetch-Control', | ||
'X-Frame-Options', | ||
'X-Permitted-Cross-Domain-Policies', | ||
'X-Powered-By', | ||
'X-Requested-With', | ||
'X-XSS-Protection' | ||
] | ||
|
||
for (let i = 0; i < wellknownHeaderNames.length; ++i) { | ||
const key = wellknownHeaderNames[i] | ||
const lowerCasedKey = key.toLowerCase() | ||
headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = | ||
lowerCasedKey | ||
} | ||
|
||
// Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. | ||
Object.setPrototypeOf(headerNameLowerCasedRecord, null) | ||
|
||
module.exports = { | ||
wellknownHeaderNames, | ||
headerNameLowerCasedRecord | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.