@ublitzjs/core 0.1.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1040 @@
1
+ import type { HttpResponse as uwsHttpResponse } from "uWebSockets.js";
2
+ type helmetHeadersT = {
3
+ /**
4
+ * By adding this header you can declare that your site should only load resources that have explicitly opted-in to being loaded across origin.
5
+ * "require-corp" LETS YOU USE new SharedArrayBuffer()
6
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Embedder-Policy
7
+ */
8
+ "Cross-Origin-Embedder-Policy": "unsafe-none" | "require-corp" | "credentialless";
9
+ /**
10
+ * whether new page opened via Window.open() should be treated differently for performance reasons
11
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Opener-Policy
12
+ */
13
+ "Cross-Origin-Opener-Policy": "unsafe-none" | "same-origin-allow-popups" | "same-origin" | "noopener-allow-popups";
14
+ /**
15
+ * From where should client fetch resources
16
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Resource-Policy
17
+ */
18
+ "Cross-Origin-Resource-Policy": "same-site" | "same-origin" | "cross-origin";
19
+ /**
20
+ * if client fetched resource, but its MIME type is different - abort request
21
+ */
22
+ "X-Content-Type-Options": "nosniff";
23
+ /**
24
+ * Safari doesn't support it
25
+ */
26
+ "X-DNS-Prefetch-Control": "on" | "off";
27
+ /**
28
+ * Sites can use this to avoid clickjacking (<iframe> html tag)
29
+ */
30
+ "X-Frame-Options": "DENY" | "SAMEORIGIN";
31
+ /**
32
+ * whether you need info about client.
33
+ */
34
+ "Referrer-Policy": "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
35
+ /**
36
+ * usually for Adobe Acrobat or Microsoft Silverlight.
37
+ */
38
+ "X-Permitted-Cross-Domain-Policies": "none" | "master-only" | "by-content-type" | "by-ftp-filename" | "all" | "none-this-response";
39
+ /**
40
+ * Whether downloaded files should be run on the client side immediately. For IE8
41
+ */
42
+ "X-Download-Options": "noopen";
43
+ /**
44
+ * similar to COOP, where ?1 is true
45
+ */
46
+ "Origin-Agent-Cluster": "?0" | "?1";
47
+ /**
48
+ *@deprecated
49
+ * */
50
+ "X-XSS-Protection"?: string;
51
+ };
52
+ type CORSHeader = {
53
+ /**
54
+ * The HTTP Access-Control-Allow-Credentials response header tells browsers whether the server allows credentials to be included in cross-origin HTTP requests.
55
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Credentials
56
+ */
57
+ "Access-Control-Allow-Credentials": "true" | "false";
58
+ /**
59
+ * Allowed headers in the request.
60
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Headers
61
+ */
62
+ "Access-Control-Allow-Headers": string;
63
+ /**
64
+ * CORS version of Allow header
65
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Methods
66
+ */
67
+ "Access-Control-Allow-Methods": string;
68
+ /**
69
+ * Allowed origins to get the resource. * - all, https://example.com - some website.
70
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Origin
71
+ */
72
+ "Access-Control-Allow-Origin": string;
73
+ /**
74
+ * The HTTP Access-Control-Expose-Headers response header allows a server to indicate which response headers should be made available to scripts running in the browser in response to a cross-origin request.
75
+
76
+ * Only the CORS-safelisted response headers are exposed by default. For clients to be able to access other headers, the server must list them using the Access-Control-Expose-Headers header.
77
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Expose-Headers
78
+ */
79
+ "Access-Control-Expose-Headers": string;
80
+ /**
81
+ * The HTTP Access-Control-Max-Age response header indicates how long the results of a preflight request (that is, the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.
82
+ * @example "600"
83
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Max-Age
84
+ */
85
+ "Access-Control-Max-Age": string;
86
+ /**
87
+ * The HTTP Access-Control-Request-Headers request header is used by browsers when issuing a preflight request to let the server know which HTTP headers the client might send when the actual request is made (such as with fetch() or XMLHttpRequest.setRequestHeader()).
88
+ *
89
+ * The complementary server-side header of Access-Control-Allow-Headers will answer this browser-side header.
90
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Request-Headers
91
+ */
92
+ "Access-Control-Request-Headers": string;
93
+ /**
94
+ * The HTTP Access-Control-Request-Method request header is used by browsers when issuing a preflight request to let the server know which HTTP method will be used when the actual request is made. This header is necessary because the preflight request is always an OPTIONS and doesn't use the same method as the actual request.
95
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Request-Method
96
+ */
97
+ "Access-Control-Request-Method": string;
98
+ };
99
+ type experimentalHeaders = {
100
+ /**
101
+ * @experimental
102
+ * The HTTP Attribution-Reporting-Eligible request header indicates that the corresponding response is eligible to register an attribution source or trigger.
103
+
104
+ This header is never set manually and is instead sent by the browser in response to various HTML element or JavaScript request settings.
105
+
106
+ Depending on the allowed registrations specified in the Attribution-Reporting-Eligible value, the server is expected to respond with either an Attribution-Reporting-Register-Source or Attribution-Reporting-Register-Trigger header to complete the registration of an attribution source or trigger, respectively.
107
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Attribution-Reporting-Eligible
108
+ */
109
+ "Attribution-Reporting-Eligible": string;
110
+ /**
111
+ * @experimental
112
+ * The HTTP Attribution-Reporting-Register-Source response header registers a page feature as an attribution source.
113
+ *
114
+ * This header is included as part of a response to a request that contains the Attribution-Reporting-Eligible header.
115
+ *
116
+ * It provides the information that the browser should store when a user interacts with the attribution source.
117
+ *
118
+ * The information you include in this header also determines the types of reports the browser can generate.
119
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Attribution-Reporting-Register-Source
120
+ */
121
+ "Attribution-Reporting-Register-Source": string;
122
+ /**
123
+ * @experimental
124
+ * The HTTP Attribution-Reporting-Register-Trigger response header registers a page feature as an attribution trigger.
125
+ *
126
+ * This header is included as part of a response to a request that contains the Attribution-Reporting-Eligible header.
127
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Attribution-Reporting-Register-Trigger
128
+ */
129
+ "Attribution-Reporting-Register-Trigger": string;
130
+ /**
131
+ * @experimental
132
+ * The HTTP Available-Dictionary request header allows the browser to specify the best matching dictionary it has to allow the server to use Compression Dictionary Transport for a resource request.
133
+
134
+ Clients can send an Available-Dictionary header when they support dcb or dcz encodings.
135
+
136
+ The header is a colon-surrounded base-64 encoded SHA-256 hash of the dictionary contents.
137
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Available-Dictionary
138
+ */
139
+ "Available-Dictionary": string;
140
+ /**
141
+ * @experimental
142
+ * The HTTP Critical-CH response header is used along with Accept-CH to identify the accepted client hints that are critical.
143
+
144
+ User agents receiving a response with Critical-CH must check if the indicated critical headers were sent in the original request.
145
+
146
+ If not, the user agent will retry the request along with the critical headers rather than render the page.
147
+
148
+ This approach ensures that client preferences set using critical client hints are always used, even if not included in the first request, or following server configuration changes.
149
+
150
+ Each header listed in the Critical-CH header should also be present in the Accept-CH and Vary headers.
151
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Critical-CH
152
+ */
153
+ "Critical-CH": string;
154
+ /**
155
+ * @experimental
156
+ * The HTTP Dictionary-ID request header references a dictionary that can be used in Compression Dictionary Transport to compress the server's response.
157
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Dictionary-ID
158
+ **/
159
+ "Dictionary-ID": string;
160
+ /**
161
+ * @experimental10
162
+ * The HTTP Device-Memory request header is used in device client hints to indicate the approximate amount of available RAM on the client device, in gigabytes. The header is part of the Device Memory API.
163
+
164
+ Client hints are accessible only on secure origins.
165
+
166
+ A server has to opt in to receive the Device-Memory header from the client, by first sending the Accept-CH response header.
167
+
168
+ Servers that opt in to the Device-Memory client hint will typically also specify it in the Vary header to inform caches that the server may send different responses based on the header value in a request.
169
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Device-Memory
170
+ */
171
+ "Device-Memory": string;
172
+ /**
173
+ * @deprecated
174
+ * @experimental
175
+ * The HTTP DNT (Do Not Track) request header indicates the user's tracking preference.
176
+ *
177
+ * It lets users indicate whether they would prefer privacy rather than personalized content.
178
+
179
+ DNT is deprecated in favor of Global Privacy Control, which is communicated to servers using the Sec-GPC header, and accessible to clients from navigator.globalPrivacyControl.
180
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/DNT
181
+ **/
182
+ DNT: string;
183
+ /**
184
+ * The HTTP Downlink request header is used in Client Hints to provide the approximate bandwidth in Mbps of the client's connection to the server.
185
+
186
+ The hint allows a server to choose what information is sent based on the network bandwidth.
187
+
188
+ For example, a server might choose to send smaller versions of images and other resources on low bandwidth networks.
189
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Downlink
190
+ **/
191
+ Downlink: string;
192
+ /**
193
+ * @deprecated
194
+ * The HTTP DPR request header provides device client hints about the client device pixel ratio (DPR). This ratio is the number of physical device pixels corresponding to every CSS pixel.
195
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/DPR
196
+ **/
197
+ DPR: string;
198
+ /**
199
+ * @experimental
200
+ * The HTTP Early-Data request header is set by an intermediary to indicate that the request has been conveyed in TLS early data, and also indicates that the intermediary understands the 425 Too Early status code.
201
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Early-Data
202
+ * */
203
+ "Early-Data": string;
204
+ /**
205
+ * @experimental
206
+ *The HTTP ECT request header is used in Client Hints to indicate the effective connection type: slow-2g, 2g, 3g, or 4g.
207
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ECT
208
+ * */
209
+ ECT: string;
210
+ /**
211
+ * @experimental
212
+ * The HTTP NEL response header is used to configure network request logging.
213
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/NEL
214
+ * */
215
+ NEL: string;
216
+ /**
217
+ *@experimental
218
+ The HTTP No-Vary-Search response header specifies a set of rules that define how a URL's query parameters will affect cache matching.
219
+
220
+ These rules dictate whether the same URL with different URL parameters should be saved as separate browser cache entries.A
221
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/No-Vary-Search
222
+ * */
223
+ "No-Vary-Search": string;
224
+ /**
225
+ *@experimental
226
+ * The HTTP Observe-Browsing-Topics response header is used to mark topics of interest inferred from a calling site's URL (i.e., the site where the ad tech <iframe> is embedded) as observed in the response to a request generated by a feature that enables the Topics API. The browser will subsequently use those topics to calculate top topics for the current user for future epochs.
227
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Observe-Browsing-Topics
228
+ * */
229
+ "Observe-Browsing-Topics": string;
230
+ /**
231
+ * @experimental
232
+ *The HTTP Permissions-Policy response header provides a mechanism to allow and deny the use of browser features in a document or within any <iframe> elements in the document.
233
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Permissions-Policy
234
+ * */
235
+ "Permissions-Policy": string;
236
+ /**
237
+ *@experimental
238
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/RTT
239
+ * */
240
+ RTT: string;
241
+ /**
242
+ *@experimental
243
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/RTT
244
+ * */
245
+ "Save-Data": string;
246
+ /**
247
+ *@experimental
248
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Browsing-Topics
249
+ * */
250
+ "Sec-Browsing-Topics": string;
251
+ /**
252
+ *@experimental
253
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-Prefers-Color-Scheme
254
+ * */
255
+ "Sec-CH-Prefers-Color-Scheme": string;
256
+ /**
257
+ * @experimental
258
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-Prefers-Reduced-Motion
259
+ * */
260
+ "Sec-CH-Prefers-Reduced-Motion": string;
261
+ /**
262
+ *@experimental
263
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-Prefers-Reduced-Transparency
264
+ * */
265
+ "Sec-CH-Prefers-Reduced-Transparency": string;
266
+ /**
267
+ *@experimental
268
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA
269
+ * */
270
+ "Sec-CH-UA": string;
271
+ /**
272
+ * @experimental
273
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Arch
274
+ * */
275
+ "Sec-CH-UA-Arch": string;
276
+ /**
277
+ * @experimental
278
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Bitness
279
+ * */
280
+ "Sec-CH-UA-Bitness": string;
281
+ /**
282
+ *@experimental
283
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Form-Factors
284
+ * */
285
+ "Sec-CH-UA-Form-Factors": string;
286
+ /**
287
+ *@deprecated
288
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Full-Version
289
+ * */
290
+ "Sec-CH-UA-Full-Version": string;
291
+ /**
292
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Full-Version-List
293
+ @experimental
294
+ * */
295
+ "Sec-CH-UA-Full-Version-List": string;
296
+ /**
297
+ *@experimental
298
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Mobile
299
+ * */
300
+ "Sec-CH-UA-Mobile": string;
301
+ /**
302
+ *@experimental
303
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Model
304
+ * */
305
+ "Sec-CH-UA-Model": string;
306
+ /**
307
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Platform
308
+ @experimental
309
+ * */
310
+ "Sec-CH-UA-Platform": string;
311
+ /**
312
+ *@experimental
313
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Platform-Version
314
+ * */
315
+ "Sec-CH-UA-Platform-Version": string;
316
+ /**
317
+ *@experimental
318
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-WoW64
319
+ * */
320
+ "Sec-CH-UA-WoW64": string;
321
+ /**
322
+ *@experimental
323
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-GPC
324
+ * */
325
+ "Sec-GPC": string;
326
+ /**
327
+ *@experimental
328
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Speculation-Tags
329
+ * */
330
+ "Sec-Speculation-Tags": string;
331
+ /**
332
+ *@experimental
333
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Purpose
334
+ * */
335
+ "Sec-Purpose": string;
336
+ /**
337
+ * @experimental
338
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Speculation-Rules
339
+ The HTTP Speculation-Rules response header provides one or more URLs pointing to text resources containing speculation rule JSON definitions. When the response is an HTML document, these rules will be added to the document's speculation rule set. See the Speculation Rules API for more information.
340
+ * */
341
+ "Speculation-Rules": string;
342
+ /**
343
+ * @experimental
344
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Supports-Loading-Mode
345
+ * */
346
+ "Supports-Loading-Mode": string;
347
+ /**
348
+ * @experimental
349
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Use-As-Dictionary
350
+ * */
351
+ "Use-As-Dictionary": string;
352
+ };
353
+ type simpleHeaders = {
354
+ /**
355
+ * indicates which content types, expressed as MIME types, the sender is able to understand
356
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept
357
+ */
358
+ Accept: string;
359
+ /**
360
+ * The HTTP Accept-CH response header may be set by a server to specify which client hint headers should be included by the client in subsequent requests. To ensure client hints are sent reliably, the Accept-CH header should be persisted for all secure requests.
361
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-CH
362
+ */
363
+ "Accept-CH": string;
364
+ /**
365
+ * The HTTP Accept-Encoding request and response header indicates the content encoding (usually a compression algorithm) that the sender can understand.
366
+ *
367
+ * In requests, the server uses content negotiation to select one of the encoding proposals from the client and informs the client of that choice with the Content-Encoding response header.
368
+ *
369
+ * In responses, it provides information about which content encodings the server can understand in messages to the requested resource, so that the encoding can be used in subsequent requests to the resource.
370
+ *
371
+ * For example, Accept-Encoding is included in a 415 Unsupported Media Type response if a request to a resource (e.g., PUT) used an unsupported encoding.
372
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Encoding
373
+ */
374
+ "Accept-Encoding": string;
375
+ /**
376
+ * The HTTP Accept-Language request header indicates the natural language and locale that the client prefers.\
377
+ * The server uses content negotiation to select one of the proposals and informs the client of the choice with the Content-Language response header.
378
+ *
379
+ * Browsers set required values for this header according to their active user interface language.\
380
+ * Users can also configure additional preferred languages through browser settings.
381
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Language
382
+ */
383
+ "Accept-Language": string;
384
+ /**
385
+ * The HTTP Accept-Patch response header advertises which media types the server is able to understand in a PATCH request. For example, a server receiving a PATCH request with an unsupported media type could reply with 415 Unsupported Media Type and an Accept-Patch header referencing one or more supported media types.
386
+
387
+ * The header should appear in OPTIONS requests to a resource that supports the PATCH method. An Accept-Patch header in a response to any request method implicitly means that a PATCH is allowed on the target resource in the request.
388
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Patch
389
+ */
390
+ "Accept-Patch": string;
391
+ /**
392
+ * The HTTP Accept-Post response header advertises which media types are accepted by the server in a POST request. For example, a server receiving a POST request with an unsupported media type could reply with 415 Unsupported Media Type and an Accept-Post header referencing one or more supported media types.
393
+
394
+ * The header should appear in OPTIONS requests to a resource that supports the POST method. An Accept-Post header in a response to any request method implicitly means that a POST is allowed on the target resource in the request.
395
+ @example
396
+ "application/json"
397
+ "image/webp, text/plain"
398
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Post
399
+ */
400
+ "Accept-Post": string;
401
+ /**
402
+ * The HTTP Accept-Ranges response header is used by the server to advertise its support for range requests, allowing clients to request part or several parts of a resource. The value of this header indicates the unit that can be used to define a range.
403
+
404
+ * For example, a response with an Accept-Ranges header indicates that the server is capable of resuming an interrupted download instead of a client restarting the transfer in full.
405
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Ranges
406
+ */
407
+ "Accept-Ranges": "bytes" | "none";
408
+ /**
409
+ * The HTTP Age response header indicates the time in seconds for which an object was in a proxy cache.
410
+
411
+ * The header value is usually close to zero. If the value is 0, the object was probably fetched from the origin server; otherwise, the value is usually calculated as a difference between the proxy's current date and the Date general header included in the HTTP response.
412
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Age
413
+ */
414
+ Age: string;
415
+ /**
416
+ * The HTTP Allow response header lists the set of request methods supported by a resource.
417
+ *
418
+ * This header must be sent if the server responds with a 405 Method Not Allowed status code to indicate which request methods can be used instead.
419
+ *
420
+ * An empty Allow value indicates that the resource allows no request methods, which might occur temporarily for a given resource.
421
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Allow
422
+ */
423
+ Allow: string;
424
+ /**
425
+ * The HTTP Alt-Svc response header lets a server indicate that another network location (the "alternative service") can be treated as authoritative for that origin when making future requests.
426
+
427
+ Doing so allows new protocol versions to be advertised without affecting in-flight requests and can also help servers manage traffic.
428
+
429
+ Using an alternative service is not visible to the end user; it does not change the URL or the origin of the request and does not introduce additional round trips.
430
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Alt-Svc
431
+ */
432
+ "Alt-Svc": string;
433
+ /**
434
+ * The HTTP Alt-Used request header is used to identify the alternative service in use, just as the Host HTTP header field identifies the host and port of the origin.
435
+
436
+ The is intended to allow alternative services to detect loops, differentiate traffic for purposes of load balancing, and generally to ensure that it is possible to identify the intended destination of traffic, since introducing this information after a protocol is in use has proven to be problematic.
437
+
438
+ When a client uses an alternative service for a request, it can indicate this to the server using the Alt-Used HTTP header.
439
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Alt-Used
440
+ */
441
+ "Alt-Used": string;
442
+ /**
443
+ * The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to protected resources.
444
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization
445
+ */
446
+ Authorization: string;
447
+ /**
448
+ *The HTTP Cache-Control header holds directives (instructions) in both requests and responses that control caching in browsers and shared caches (e.g., Proxies, CDNs).
449
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control
450
+ */
451
+ "Cache-Control": string;
452
+ /**
453
+ * The HTTP Clear-Site-Data response header sends a signal to the client that it should remove all browsing data of certain types (cookies, storage, cache) associated with the requesting website.
454
+ *
455
+ * It allows web developers to have more control over the data stored by browsers for their origins.
456
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Clear-Site-Data
457
+ */
458
+ "Clear-Site-Data": string;
459
+ /**
460
+ * The HTTP Connection header controls whether the network connection stays open after the current transaction finishes.
461
+ *
462
+ * If the value sent is keep-alive, the connection is persistent and not closed, allowing subsequent requests to the same server on the same connection.
463
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Connection
464
+ */
465
+ Connection: string;
466
+ /**
467
+ * The HTTP Content-Digest request and response header provides a digest calculated using a hashing algorithm applied to the message content.
468
+ *
469
+ * A recipient can use the Content-Digest to validate the HTTP message content for integrity purposes.
470
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Digest
471
+ */
472
+ "Content-Digest": string;
473
+ /**
474
+ * The HTTP Content-Disposition header indicates whether content should be displayed inline in the browser as a web page or part of a web page or downloaded as an attachment locally.
475
+ *
476
+ * In a multipart body, the header must be used on each subpart to provide information about its corresponding field.
477
+ *
478
+ * The subpart is delimited by the boundary defined in the Content-Type header. When used on the body itself, Content-Disposition has no effect.
479
+
480
+ The Content-Disposition header is defined in the larger context of MIME messages for email, but only a subset of the possible parameters apply to HTTP forms and POST requests.
481
+
482
+ Only the value form-data, as well as the optional directive name and filename, can be used in the HTTP context.
483
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Disposition
484
+ */
485
+ "Content-Disposition": string;
486
+ /**
487
+ * @deprecated
488
+ * The HTTP Content-DPR response header is used to confirm the image device to pixel ratio (DPR) in requests where the screen DPR client hint was used to select an image resource.
489
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-DPR
490
+ */
491
+ "Content-DPR": string;
492
+ /**
493
+ * The HTTP Content-Encoding representation header lists the encodings and the order in which they have been applied to a resource.
494
+ *
495
+ * This lets the recipient know how to decode the data in order to obtain the original content format described in the Content-Type header.
496
+ *
497
+ * Content encoding is mainly used to compress content without losing information about the original media type.
498
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding
499
+ */
500
+ "Content-Encoding": string;
501
+ /**
502
+ * The HTTP Content-Language representation header is used to describe the language(s) intended for the audience, so users can differentiate it according to their own preferred language.
503
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Language
504
+ */
505
+ "Content-Language": string;
506
+ /**
507
+ * Length in bytes of content, you send or receive.
508
+ * @type number. BUT here it is a string
509
+ */
510
+ "Content-Length": string;
511
+ /**
512
+ * The HTTP Content-Location representation header indicates an alternate location for the returned data.
513
+ *
514
+ * It's main use is to indicate the URL of a resource transmitted as the result of content negotiation.
515
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Location
516
+ */
517
+ "Content-Location": string;
518
+ /**
519
+ * The HTTP Content-Range response header is used in range requests to indicate where the content of a response body belongs in relation to a complete resource.
520
+
521
+ It should only be included in 206 Partial Content or 416 Range Not Satisfiable responses.
522
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Range
523
+ */
524
+ "Content-Range": string;
525
+ /**
526
+ * The HTTP Content-Security-Policy response header allows website administrators to control resources the user agent is allowed to load for a given page.
527
+ *
528
+ * With a few exceptions, policies mostly involve specifying server origins and script endpoints. This helps guard against cross-site scripting attacks.
529
+ *
530
+ * @use setCSP function
531
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy
532
+ */
533
+ "Content-Security-Policy": string;
534
+ /**
535
+ * The HTTP Content-Security-Policy-Report-Only response header helps to monitor Content Security Policy (CSP) violations and their effects without enforcing the security policies.
536
+ *
537
+ * This header allows you to test or repair violations before a specific Content-Security-Policy is applied and enforced.
538
+
539
+ The CSP report-to directive must be specified for reports to be sent: if not, the operation won't have any effect.
540
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy-Report-Only
541
+ */
542
+ "Content-Security-Policy-Report-Only": string;
543
+ /**
544
+ * You know this one. It is "text/html" or "video/mp4" or whatever
545
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type
546
+ */
547
+ "Content-Type": string;
548
+ /**
549
+ * The HTTP Cookie request header contains stored HTTP cookies associated with the server (i.e., previously sent by the server with the Set-Cookie header or set in JavaScript using Document.cookie)
550
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cookie
551
+ */
552
+ Cookie: string;
553
+ /**
554
+ * The HTTP Date request and response header contains the date and time at which the message originated.
555
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Date
556
+ */
557
+ Date: string;
558
+ /**
559
+ * The HTTP ETag (entity tag) response header is an identifier for a specific version of a resource.
560
+ *
561
+ * It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.
562
+ *
563
+ * Additionally, ETags help to prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions").
564
+ * If the resource at a given URL changes, a new Etag value must be generated. A comparison of them can determine whether two representations of a resource are the same.
565
+ * @see
566
+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag
567
+ * */
568
+ Etag: string;
569
+ /**
570
+ *The HTTP Expect request header indicates that there are expectations that need to be met by the server in order to handle the complete request successfully.
571
+
572
+ When a request has an Expect: 100-continue header, a server sends a 100 Continue response to indicate that the server is ready or capable of receiving the rest of the request content. Waiting for a 100 response can be helpful if a client anticipates that an error is likely, for example, when sending state-changing operations without previously verified authentication credentials.
573
+
574
+ A 417 Expectation Failed response is returned if the server cannot meet the expectation, or any other status otherwise (e.g., a 4XX status for a client error, or a 2XX status if the request can be resolved successfully without further processing).
575
+
576
+ None of the more common browsers send the Expect header, but some clients (command-line tools) do so by default.
577
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect
578
+ * */
579
+ Expect: string;
580
+ /**
581
+ * @deprecated
582
+ * The Expect-CT response header lets sites opt in to reporting and/or enforcement of Certificate Transparency requirements. Certificate Transparency (CT) aims to prevent the use of misissued certificates for that site from going unnoticed.
583
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expect-CT
584
+ * */
585
+ "Expect-CT": string;
586
+ /**
587
+ *The HTTP Expires response header contains the date/time after which the response is considered expired in the context of HTTP caching.
588
+
589
+ The value 0 is used to represent a date in the past, indicating the resource has already expired.
590
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Expires
591
+ * */
592
+ Expires: string;
593
+ /**
594
+ * The HTTP Forwarded request header contains information that may be added by reverse proxy servers (load balancers, CDNs, etc.) that would otherwise be altered or lost when proxy servers are involved in the path of the request.
595
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Forwarded
596
+ * */
597
+ Forwared: string;
598
+ /**
599
+ * The HTTP From request header contains an Internet email address for an administrator who controls an automated user agent.
600
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/From
601
+ * */
602
+ From: string;
603
+ /**
604
+ * The HTTP Host request header specifies the host and port number of the server to which the request is being sent.
605
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Host
606
+ * */
607
+ Host: string;
608
+ /**
609
+ * The HTTP If-Match request header makes a request conditional. A server will return resources for GET and HEAD methods, or upload resource for PUT and other non-safe methods, only if the resource matches one of the ETag values in the If-Match request header. If the conditional does not match, the 412 Precondition Failed response is returned instead.
610
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Match
611
+ * */
612
+ "If-Match": string;
613
+ /**
614
+ * The HTTP If-Modified-Since request header makes a request conditional. The server sends back the requested resource, with a 200 status, only if it has been modified after the date in the If-Modified-Since header. If the resource has not been modified since, the response is a 304 without any body, and the Last-Modified response header of the previous request contains the date of the last modification.
615
+
616
+ Unlike If-Unmodified-Since, If-Modified-Since can only be used with a GET or HEAD. When used in combination with If-None-Match, it is ignored, unless the server doesn't support If-None-Match.
617
+
618
+ The most common use case is to update a cached entity that has no associated ETag.
619
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Modified-Since
620
+ * */
621
+ "If-Modified-Since": string;
622
+ /**
623
+ *The HTTP If-None-Match request header makes a request conditional. The server returns the requested resource in GET and HEAD methods with a 200 status, only if it doesn't have an ETag matching the ones in the If-None-Match header. For other methods, the request will be processed only if the eventually existing resource's ETag doesn't match any of the values listed.
624
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-None-Match
625
+ * */
626
+ "If-None-Match": string;
627
+ /**
628
+ * The HTTP If-Range request header makes a range request conditional. If the condition is fulfilled, a range request is issued, and the server sends back a 206 Partial Content response with part (or parts) of the resource in the body. If the condition is not fulfilled, the full resource is sent back with a 200 OK status.
629
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Range
630
+ * */
631
+ "If-Range": string;
632
+ /**
633
+ *The HTTP If-Unmodified-Since request header makes the request for the resource conditional. The server will send the requested resource (or accept it in the case of a POST or another non-safe method) only if the resource on the server has not been modified after the date in the request header. If the resource has been modified after the specified date, the response will be a 412 Precondition Failed error.
634
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/If-Unmodified-Since
635
+ * */
636
+ "If-Unmodified-Since": string;
637
+ /**
638
+ *The HTTP Integrity-Policy response header allows website administrators to ensure that all resources the user agent loads (of a certain type) have Subresource Integrity guarantees.
639
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Integrity-Policy
640
+ * */
641
+ "Integrity-Policy": string;
642
+ /**
643
+ * The HTTP Integrity-Policy-Report-Only response header allows website administrators to report on resources that the user agent loads that would violate Subresource Integrity guarantees if the integrity policy was enforced (using the Integrity-Policy header).
644
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Integrity-Policy-Report-Only
645
+ * */
646
+ "Integrity-Policy-Report-Only": string;
647
+ /**
648
+ *The HTTP Keep-Alive request and response header allows the sender to hint how a connection may be used in terms of a timeout and a maximum amount of requests.
649
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Keep-Alive
650
+ * */
651
+ "Keep-Alive": string;
652
+ /**
653
+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Last-Modified
654
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Last-Modified
655
+ * */
656
+ "Last-Modified": string;
657
+ /**
658
+ * The HTTP Link header provides a means for serializing one or more links in HTTP headers.
659
+ *
660
+ * This allows the server to point a client to another resource containing metadata about the requested resource.
661
+ *
662
+ * This header has the same semantics as the HTML <link> element.
663
+ *
664
+ * One benefit of using the Link header is that the browser can start preconnecting or preloading resources before the HTML itself is fetched and processed.
665
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Link
666
+ * */
667
+ Link: string;
668
+ /**
669
+ *The HTTP Location response header indicates the URL to redirect a page to. It only provides a meaning when served with a 3XX redirection response or a 201 Created status response.
670
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Location
671
+ * */
672
+ Location: string;
673
+ /**
674
+ *The HTTP Max-Forwards request header is used with the TRACE method to limit the number of nodes (usually proxies) that the request goes through.
675
+
676
+ Its value is an integer indicating the maximum amount of nodes it must visit.
677
+
678
+ At each node, the value is decremented and the TRACE request is forwarded to the next node until the destination is reached or the received value of Max-Forwards is zero.
679
+
680
+ The request is then sent back (excluding sensitive headers where appropriate) as the body of a 200 response.
681
+
682
+ This allows the client to see what is being received at the other end of the request chain (the Via header is of particular interest) for testing or diagnostic purposes.
683
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Max-Forwards
684
+ * */
685
+ "Max-Forwards": string;
686
+ /**
687
+ *The HTTP Origin request header indicates the origin (scheme, hostname, and port) that caused the request. For example, if a user agent needs to request resources included in a page, or fetched by scripts that it executes, then the origin of the page may be included in the request.
688
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Origin
689
+ * */
690
+ Origin: string;
691
+ /**
692
+ *@deprecated
693
+ The HTTP Pragma header is an implementation-specific header that may have various effects along the request-response chain.
694
+
695
+ This header serves for backwards compatibility with HTTP/1.0 caches that do not support the Cache-Control HTTP/1.1 header.
696
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Pragma
697
+ * */
698
+ Pragma: string;
699
+ /**
700
+ *The HTTP Prefer header allows clients to indicate preferences for specific server behaviors during request processing.
701
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Prefer
702
+ * */
703
+ Prefer: string;
704
+ /**
705
+ *The HTTP Preference-Applied header informs the client about which preferences from the Prefer request header were applied by the server.
706
+
707
+ The server indicates if a preference is applied to a response if it would otherwise be ambiguous for the client.
708
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Preference-Applied
709
+ * */
710
+ "Preference-Applied": string;
711
+ /**
712
+ *The HTTP Priority header indicates a client's preference for the priority order at which the response containing the requested resource should be sent, relative to other resource requests on the same connection.
713
+
714
+ If the header is not specified in the request, a default priority is assumed.
715
+
716
+ The server may also include this header in responses in order to indicate it has an interest in changing the prioritization preferences the client advertized.
717
+
718
+ In responses, this information can be used as an input to the prioritization process for caching servers and other servers that are forwarding the response.
719
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Priority
720
+ * */
721
+ Priority: string;
722
+ /**
723
+ *The HTTP Proxy-Authenticate response header defines the authentication method (or challenge) that should be used to gain access to a resource behind a proxy server.
724
+
725
+ It is sent in a 407 Proxy Authentication Required response so a client can identify itself to a proxy that requires authentication.
726
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authenticate
727
+ * */
728
+ "Proxy-Authenticate": string;
729
+ /**
730
+ *The HTTP Proxy-Authorization request header contains the credentials to authenticate a client with a proxy server, typically after the server has responded with a 407 Proxy Authentication Required status with the Proxy-Authenticate header.
731
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authorization
732
+ * */
733
+ "Proxy-Authorization": string;
734
+ /**
735
+ *The HTTP Range request header indicates the part of a resource that the server should return.
736
+
737
+ Several parts can be requested at the same time in one Range header, and the server may send back these ranges in a multipart document.
738
+
739
+ If the server sends back ranges, it uses the 206 Partial Content status code for the response. If the ranges are invalid, the server returns the 416 Range Not Satisfiable error.
740
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Range
741
+ * */
742
+ Range: string;
743
+ /**
744
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Referer
745
+ * */
746
+ Referer: string;
747
+ /**
748
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Refresh
749
+ * */
750
+ Refresh: string;
751
+ /**
752
+ * @deprecated
753
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Report-To
754
+ * */
755
+ "Report-To": string;
756
+ /**
757
+ *@limitedAvailability
758
+ @see https://developer.mozilla.org/en-US/docs/Web
759
+ * */
760
+ "Reporting-Endpoints": string;
761
+ /**
762
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Repr-Digest
763
+ * */
764
+ "Repr-Digest": string;
765
+ /**
766
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After
767
+ * */
768
+ "Retry-After": string;
769
+ /**
770
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Dest
771
+ * */
772
+ "Sec-Fetch-Dest": string;
773
+ /**
774
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Mode
775
+ * */
776
+ "Sec-Fetch-Mode": string;
777
+ /**
778
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site
779
+ * */
780
+ "Sec-Fetch-Site": string;
781
+ /**
782
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-User
783
+ * */
784
+ "Sec-Fetch-User": string;
785
+ /**
786
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Accept
787
+ * */
788
+ "Sec-WebSocket-Accept": string;
789
+ /**
790
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Extensions
791
+ * */
792
+ "Sec-WebSocket-Extensions": string;
793
+ /**
794
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Key
795
+ * */
796
+ "Sec-WebSocket-Key": string;
797
+ /**
798
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Protocol
799
+ * */
800
+ "Sec-WebSocket-Protocol": string;
801
+ /**
802
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-WebSocket-Version
803
+ * */
804
+ "Sec-WebSocket-Version": string;
805
+ /**
806
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Server
807
+ * */
808
+ Server: string;
809
+ /**
810
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Server-Timing
811
+ * */
812
+ "Server-Timing": string;
813
+ /**
814
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Service-Worker
815
+ * */
816
+ "Service-Worker": string;
817
+ /**
818
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Service-Worker-Allowed
819
+ * */
820
+ "Service-Worker-Allowed": string;
821
+ /**
822
+ * @limitedAvailability
823
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Service-Worker-Navigation-Preload
824
+ * */
825
+ "Service-Worker-Navigation-Preload header": string;
826
+ /**
827
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie
828
+ * */
829
+ "Set-Cookie": string;
830
+ /**
831
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Login
832
+ * */
833
+ "Set-Login": string;
834
+ /**
835
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/SourceMap
836
+ * */
837
+ SourceMap: string;
838
+ /**
839
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security
840
+ * */
841
+ "Strict-Transport-Security": string;
842
+ /**
843
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/TE
844
+ * */
845
+ TE: string;
846
+ /**
847
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Timing-Allow-Origin
848
+ **/
849
+ "Timing-Allow-Origin": string;
850
+ /**
851
+ *@deprecated
852
+ @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Tk
853
+ * */
854
+ Tk: string;
855
+ /**
856
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Trailer
857
+ * */
858
+ Trailer: string;
859
+ /**
860
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Transfer-Encoding
861
+ * */
862
+ "Transfer-Encoding": string;
863
+ /**
864
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade
865
+ * */
866
+ Upgrade: string;
867
+ /**
868
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Upgrade-Insecure-Requests
869
+ * */
870
+ "Upgrade-Insecure-Requests": string;
871
+ /**
872
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent
873
+ * */
874
+ "User-Agent": string;
875
+ /**
876
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary
877
+ * */
878
+ Vary: string;
879
+ /**
880
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Via
881
+ * */
882
+ Via: string;
883
+ /**
884
+ *@deprecated
885
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Viewport-Width
886
+ * */
887
+ "Viewport-Width": string;
888
+ /**
889
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Want-Content-Digest
890
+ * */
891
+ "Want-Content-Digest": string;
892
+ /**
893
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Want-Repr-Digest
894
+ * */
895
+ "Want-Repr-Digest": string;
896
+ /**
897
+ * @deprecated
898
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Warning
899
+ * */
900
+ Warning: string;
901
+ /**
902
+ * @deprecated
903
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Width
904
+ * */
905
+ Width: string;
906
+ /**
907
+ *@see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate
908
+ * */
909
+ "WWW-Authenticate": string;
910
+ };
911
+ export type BaseHeaders = Partial<simpleHeaders & helmetHeadersT & experimentalHeaders & CORSHeader & {
912
+ [key: string]: string;
913
+ }>;
914
+ /**
915
+ * A map containing all headers as ArrayBuffers, so speed remains. There are several use cases of it:
916
+ * 1) Don't define them in requests ( post(res){new HeadersMap({...headers}).prepare().toRes(res)} ). This is slow. Define maps BEFORE actual usage.
917
+ * 2) You can pass them in LightMethod or HeavyMethod in shared property (but handle it manually)
918
+ * 3) Don't define them before writing status on request. uWebSockets.js after first written header considers response as successful and puts "200" code automatically. Set headers AFTER validation in class controllers (handler function) and after writing status (or don't write it at all. It will be 200).
919
+ */
920
+ export declare class HeadersMap<Opts extends BaseHeaders> extends Map {
921
+ currentHeaders: undefined | Opts;
922
+ constructor(opts: Opts);
923
+ /**
924
+ * remove several headers from this map. Use BEFORE map.prepare(), because it will compare them by location in memory (string !== ArrayBuffer)
925
+ * @example HeadersMap.default.remove("Content-Security-Policy", "X-DNS-Prefetch-Control", ...otherHeaders).prepare()
926
+ */
927
+ remove(...keys: (keyof Opts)[]): this;
928
+ /**
929
+ * last function before "going to response". It converts all strings to ArrayBuffers, so you should delete unwanted headers before it
930
+ * @returns function, which sets all headers on the response.
931
+ * @example
932
+ * new HeadersMap({...HeadersMap.baseObj,"a":"a"}).remove("a").prepare();
933
+ */
934
+ prepare<T extends uwsHttpResponse>(): (res: T) => T;
935
+ /**
936
+ * write all static headers to response. Use BEFORE map.prepare function, because this function requires "currentHeaders" object.
937
+ * @example
938
+ * headersMap.toRes(res);
939
+ */
940
+ toRes<T extends uwsHttpResponse>(res: T): T;
941
+ /**
942
+ * obj, containing basic headers, which u can use as a background for own headers. It is mutable, but doing so will modify "HeadersMap.default" behavior
943
+ * @example
944
+ * new HeadersMap({...HeadersMap.baseObj, "ownHeader":"hello world"}).remove("X-Download-Options")
945
+ */
946
+ static baseObj: helmetHeadersT;
947
+ /**
948
+ * this is same as "toRes", but it uses HeadersMap.baseObj
949
+ */
950
+ static default<T extends uwsHttpResponse>(res: T): T;
951
+ }
952
+ /**
953
+ * This function creates Content-Security-Policy string.
954
+ */
955
+ export declare function setCSP<T extends CSP>(mainCSP: T, ...remove: (keyof CSP)[]): string;
956
+ type CSP = Partial<typeof CSPDirs & {
957
+ /**
958
+ * for websites with deprecated urls.
959
+ */
960
+ "upgrade-insecure-requests": string[];
961
+ }>;
962
+ /**
963
+ * Usual CSP directories. If you want more dirs:
964
+ * 1) I will put more in soon
965
+ * 2) use string concatenation (use BASE)
966
+ * @example
967
+ * new HeadersMap({...HeadersMap.baseObj, "Content-Security-Policy":setCSP({...CSPDirs}) + " your-dir: 'self';"})
968
+ */
969
+ export declare var CSPDirs: {
970
+ /**
971
+ * basic urls for resources, if other directives are missing
972
+ */
973
+ "default-src": string[];
974
+ /**
975
+ *used for html <base> tag
976
+ */
977
+ "base-uri": string[];
978
+ /**
979
+ * urls valid for css at-rule @font-face
980
+ */
981
+ "font-src": string[];
982
+ /**
983
+ * urls, allowed for <form action=""> action attribute. Forbidden at all='none'
984
+ */
985
+ "form-action": string[];
986
+ /**
987
+ * urls of sites, WHICH can embed YOUR page via <iframe> etc. 'none' = forbidden at all
988
+ */
989
+ "frame-ancestors": string[];
990
+ /**
991
+ * valid image urls. 'none' = forbidden at all
992
+ */
993
+ "img-src": string[];
994
+ /**
995
+ * controls urls of WebSocket, fetch, fetchLater, EventSources and Navigator.sendBeacon functions or ping attribute of <a> tag.
996
+ */
997
+ "connect-src": string[];
998
+ /**
999
+ * usually stuff it has influence on is deprecated, so put 'none'
1000
+ */
1001
+ "object-src": string[];
1002
+ /**
1003
+ * Urls for script tags. But also it forbids inline js scripts. 'none' - forbidden, 'self' - your site's scripts, 'unsafe-inline' - allows inline scripts
1004
+ */
1005
+ "script-src": string[];
1006
+ /**
1007
+ * More important than "script-src", specifies inline js scripts. 'unsafe-inline' - allow onclick and other inline attributes
1008
+ */
1009
+ "script-src-attr": string[];
1010
+ /**
1011
+ * More important than "script-src", specifies urls for <script> tag. 'none' - forbidden; 'unsafe-inline' - allow <script> tag without src=""; 'unsafe-eval' - for protobufjs;
1012
+ */
1013
+ "script-src-elem": string[];
1014
+ /**
1015
+ * Urls for style tags. But also it forbids inline css styles. 'none' - forbidden, 'self' - your site's styles, 'unsafe-inline' - allows inline styles
1016
+ */
1017
+ "style-src": string[];
1018
+ /**
1019
+ * More important than "style-src", specifies inline css styles.
1020
+ */
1021
+ "style-src-attr": string[];
1022
+ /**
1023
+ * More important than "style-src", specifies urls for <link> tag
1024
+ */
1025
+ "style-src-elem": string[];
1026
+ /**
1027
+ * Trusted Types XSS DOM API names. 'allow-duplicates', 'none'. Works for Chrome and Edge.
1028
+ */
1029
+ "trusted-types": string[];
1030
+ /**
1031
+ * specifies valid sources for Worker, SharedWorker, or ServiceWorker scripts.
1032
+ */
1033
+ "worker-src": string[];
1034
+ /**
1035
+ * specifies valid sources for loading media using the <audio> and <video> elements.
1036
+ */
1037
+ "media-src": string[];
1038
+ };
1039
+ export type lowHeaders = Lowercase<keyof (simpleHeaders & helmetHeadersT & experimentalHeaders & CORSHeader)>;
1040
+ export {};