headers.ts
This file
Path
src/utils/headers.ts
333 lines · 6.7 KiB · TypeScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 82bdc4d point at it.
4.9.0Yusuke Wadabefore adoption82bdc4d
lines 1–333why, one step back1/**2 * @module3 * HTTP Headers utility.4 */56// note: https://www.iana.org/assignments/http-fields/http-fields.xhtml78export type RequestHeader =9 | 'A-IM'10 | 'Accept'11 | 'Accept-Additions'12 | 'Accept-CH'13 | 'Accept-Charset'14 | 'Accept-Datetime'15 | 'Accept-Encoding'16 | 'Accept-Features'17 | 'Accept-Language'18 | 'Accept-Patch'19 | 'Accept-Post'20 | 'Accept-Ranges'21 | 'Accept-Signature'22 | 'Access-Control'23 | 'Access-Control-Allow-Credentials'24 | 'Access-Control-Allow-Headers'25 | 'Access-Control-Allow-Methods'26 | 'Access-Control-Allow-Origin'27 | 'Access-Control-Expose-Headers'28 | 'Access-Control-Max-Age'29 | 'Access-Control-Request-Headers'30 | 'Access-Control-Request-Method'31 | 'Age'32 | 'Allow'33 | 'ALPN'34 | 'Alt-Svc'35 | 'Alt-Used'36 | 'Alternates'37 | 'AMP-Cache-Transform'38 | 'Apply-To-Redirect-Ref'39 | 'Authentication-Control'40 | 'Authentication-Info'41 | 'Authorization'42 | 'Available-Dictionary'43 | 'C-Ext'44 | 'C-Man'45 | 'C-Opt'46 | 'C-PEP'47 | 'C-PEP-Info'48 | 'Cache-Control'49 | 'Cache-Status'50 | 'Cal-Managed-ID'51 | 'CalDAV-Timezones'52 | 'Capsule-Protocol'53 | 'CDN-Cache-Control'54 | 'CDN-Loop'55 | 'Cert-Not-After'56 | 'Cert-Not-Before'57 | 'Clear-Site-Data'58 | 'Client-Cert'59 | 'Client-Cert-Chain'60 | 'Close'61 | 'CMCD-Object'62 | 'CMCD-Request'63 | 'CMCD-Session'64 | 'CMCD-Status'65 | 'CMSD-Dynamic'66 | 'CMSD-Static'67 | 'Concealed-Auth-Export'68 | 'Configuration-Context'69 | 'Connection'70 | 'Content-Base'71 | 'Content-Digest'72 | 'Content-Disposition'73 | 'Content-Encoding'74 | 'Content-ID'75 | 'Content-Language'76 | 'Content-Length'77 | 'Content-Location'78 | 'Content-MD5'79 | 'Content-Range'80 | 'Content-Script-Type'81 | 'Content-Security-Policy'82 | 'Content-Security-Policy-Report-Only'83 | 'Content-Style-Type'84 | 'Content-Type'85 | 'Content-Version'86 | 'Cookie'87 | 'Cookie2'88 | 'Cross-Origin-Embedder-Policy'89 | 'Cross-Origin-Embedder-Policy-Report-Only'90 | 'Cross-Origin-Opener-Policy'91 | 'Cross-Origin-Opener-Policy-Report-Only'92 | 'Cross-Origin-Resource-Policy'93 | 'CTA-Common-Access-Token'94 | 'DASL'95 | 'Date'96 | 'DAV'97 | 'Default-Style'98 | 'Delta-Base'99 | 'Deprecation'100 | 'Depth'101 | 'Derived-From'102 | 'Destination'103 | 'Differential-ID'104 | 'Dictionary-ID'105 | 'Digest'106 | 'DPoP'107 | 'DPoP-Nonce'108 | 'Early-Data'109 | 'EDIINT-Features'110 | 'ETag'111 | 'Expect'112 | 'Expect-CT'113 | 'Expires'114 | 'Ext'115 | 'Forwarded'116 | 'From'117 | 'GetProfile'118 | 'Hobareg'119 | 'Host'120 | 'HTTP2-Settings'121 | 'If'122 | 'If-Match'123 | 'If-Modified-Since'124 | 'If-None-Match'125 | 'If-Range'126 | 'If-Schedule-Tag-Match'127 | 'If-Unmodified-Since'128 | 'IM'129 | 'Include-Referred-Token-Binding-ID'130 | 'Isolation'131 | 'Keep-Alive'132 | 'Label'133 | 'Last-Event-ID'134 | 'Last-Modified'135 | 'Link'136 | 'Link-Template'137 | 'Location'138 | 'Lock-Token'139 | 'Man'140 | 'Max-Forwards'141 | 'Memento-Datetime'142 | 'Meter'143 | 'Method-Check'144 | 'Method-Check-Expires'145 | 'MIME-Version'146 | 'Negotiate'147 | 'NEL'148 | 'OData-EntityId'149 | 'OData-Isolation'150 | 'OData-MaxVersion'151 | 'OData-Version'152 | 'Opt'153 | 'Optional-WWW-Authenticate'154 | 'Ordering-Type'155 | 'Origin'156 | 'Origin-Agent-Cluster'157 | 'OSCORE'158 | 'OSLC-Core-Version'159 | 'Overwrite'160 | 'P3P'161 | 'PEP'162 | 'PEP-Info'163 | 'Permissions-Policy'164 | 'PICS-Label'165 | 'Ping-From'166 | 'Ping-To'167 | 'Position'168 | 'Pragma'169 | 'Prefer'170 | 'Preference-Applied'171 | 'Priority'172 | 'ProfileObject'173 | 'Protocol'174 | 'Protocol-Info'175 | 'Protocol-Query'176 | 'Protocol-Request'177 | 'Proxy-Authenticate'178 | 'Proxy-Authentication-Info'179 | 'Proxy-Authorization'180 | 'Proxy-Features'181 | 'Proxy-Instruction'182 | 'Proxy-Status'183 | 'Public'184 | 'Public-Key-Pins'185 | 'Public-Key-Pins-Report-Only'186 | 'Range'187 | 'Redirect-Ref'188 | 'Referer'189 | 'Referer-Root'190 | 'Referrer-Policy'191 | 'Refresh'192 | 'Repeatability-Client-ID'193 | 'Repeatability-First-Sent'194 | 'Repeatability-Request-ID'195 | 'Repeatability-Result'196 | 'Replay-Nonce'197 | 'Reporting-Endpoints'198 | 'Repr-Digest'199 | 'Retry-After'200 | 'Safe'201 | 'Schedule-Reply'202 | 'Schedule-Tag'203 | 'Sec-GPC'204 | 'Sec-Purpose'205 | 'Sec-Token-Binding'206 | 'Sec-WebSocket-Accept'207 | 'Sec-WebSocket-Extensions'208 | 'Sec-WebSocket-Key'209 | 'Sec-WebSocket-Protocol'210 | 'Sec-WebSocket-Version'211 | 'Security-Scheme'212 | 'Server'213 | 'Server-Timing'214 | 'Set-Cookie'215 | 'Set-Cookie2'216 | 'SetProfile'217 | 'Signature'218 | 'Signature-Input'219 | 'SLUG'220 | 'SoapAction'221 | 'Status-URI'222 | 'Strict-Transport-Security'223 | 'Sunset'224 | 'Surrogate-Capability'225 | 'Surrogate-Control'226 | 'TCN'227 | 'TE'228 | 'Timeout'229 | 'Timing-Allow-Origin'230 | 'Topic'231 | 'Traceparent'232 | 'Tracestate'233 | 'Trailer'234 | 'Transfer-Encoding'235 | 'TTL'236 | 'Upgrade'237 | 'Urgency'238 | 'URI'239 | 'Use-As-Dictionary'240 | 'User-Agent'241 | 'Variant-Vary'242 | 'Vary'243 | 'Via'244 | 'Want-Content-Digest'245 | 'Want-Digest'246 | 'Want-Repr-Digest'247 | 'Warning'248 | 'WWW-Authenticate'249 | 'X-Content-Type-Options'250 | 'X-Frame-Options'251252export type ResponseHeader =253 | 'Access-Control-Allow-Credentials'254 | 'Access-Control-Allow-Headers'255 | 'Access-Control-Allow-Methods'256 | 'Access-Control-Allow-Origin'257 | 'Access-Control-Expose-Headers'258 | 'Access-Control-Max-Age'259 | 'Age'260 | 'Allow'261 | 'Cache-Control'262 | 'Clear-Site-Data'263 | 'Content-Disposition'264 | 'Content-Encoding'265 | 'Content-Language'266 | 'Content-Length'267 | 'Content-Location'268 | 'Content-Range'269 | 'Content-Security-Policy'270 | 'Content-Security-Policy-Report-Only'271 | 'Content-Type'272 | 'Cookie'273 | 'Cross-Origin-Embedder-Policy'274 | 'Cross-Origin-Opener-Policy'275 | 'Cross-Origin-Resource-Policy'276 | 'Date'277 | 'ETag'278 | 'Expires'279 | 'Last-Modified'280 | 'Location'281 | 'Permissions-Policy'282 | 'Pragma'283 | 'Retry-After'284 | 'Save-Data'285 | 'Sec-CH-Prefers-Color-Scheme'286 | 'Sec-CH-Prefers-Reduced-Motion'287 | 'Sec-CH-UA'288 | 'Sec-CH-UA-Arch'289 | 'Sec-CH-UA-Bitness'290 | 'Sec-CH-UA-Form-Factor'291 | 'Sec-CH-UA-Full-Version'292 | 'Sec-CH-UA-Full-Version-List'293 | 'Sec-CH-UA-Mobile'294 | 'Sec-CH-UA-Model'295 | 'Sec-CH-UA-Platform'296 | 'Sec-CH-UA-Platform-Version'297 | 'Sec-CH-UA-WoW64'298 | 'Sec-Fetch-Dest'299 | 'Sec-Fetch-Mode'300 | 'Sec-Fetch-Site'301 | 'Sec-Fetch-User'302 | 'Sec-GPC'303 | 'Server'304 | 'Server-Timing'305 | 'Service-Worker-Navigation-Preload'306 | 'Set-Cookie'307 | 'Strict-Transport-Security'308 | 'Timing-Allow-Origin'309 | 'Trailer'310 | 'Transfer-Encoding'311 | 'Upgrade'312 | 'Vary'313 | 'WWW-Authenticate'314 | 'Warning'315 | 'X-Content-Type-Options'316 | 'X-DNS-Prefetch-Control'317 | 'X-Frame-Options'318 | 'X-Permitted-Cross-Domain-Policies'319 | 'X-Powered-By'320 | 'X-Robots-Tag'321 | 'X-XSS-Protection'322323export type AcceptHeader =324 | 'Accept'325 | 'Accept-Charset'326 | 'Accept-Encoding'327 | 'Accept-Language'328 | 'Accept-Patch'329 | 'Accept-Post'330 | 'Accept-Ranges'331332// note: `X-${string}` is deprecated333export type CustomHeader = string & {}