Skip to main content

http_constant/header_key/
const.rs

1use crate::*;
2
3/// The field name "headers" for Request and Response structs.
4pub const HEADERS: &str = "headers";
5
6/// The HTTP header field name `server`.
7pub const SERVER: &str = "server";
8
9/// The HTTP header field name `accept`.
10pub const ACCEPT: &str = "accept";
11
12/// The HTTP header field name `accept-encoding`, used to specify acceptable content encodings.
13pub const ACCEPT_ENCODING: &str = "accept-encoding";
14
15/// The HTTP header field name `accept-language`, used to specify preferred languages for the response.
16pub const ACCEPT_LANGUAGE: &str = "accept-language";
17
18/// The HTTP header field name `authorization`, used to specify authentication credentials.
19pub const AUTHORIZATION: &str = "authorization";
20
21/// The HTTP header field name `cache-control`, used to specify caching directives.
22pub const CACHE_CONTROL: &str = "cache-control";
23
24/// The HTTP header field name `connection`, used to specify control options for the current connection.
25pub const CONNECTION: &str = "connection";
26
27/// The HTTP header field name `cookie`, used to send cookies from the server to the client.
28pub const COOKIE: &str = "cookie";
29
30/// The HTTP header field name `date`, used to specify the date and time at which the message was sent.
31pub const DATE: &str = "date";
32
33/// The HTTP header field name `etag`, used to specify a unique identifier for a resource version.
34pub const ETAG: &str = "etag";
35
36/// The HTTP header field name `host`, used to specify the host and port number of the server.
37pub const HOST: &str = "host";
38
39/// The HTTP header field name `last-modified`, used to specify the last modification date of the resource.
40pub const LAST_MODIFIED: &str = "last-modified";
41
42/// The HTTP header field name `location`, used to specify the url to redirect a client.
43pub const LOCATION: &str = "location";
44
45/// The HTTP header field name `referer`, used to specify the url of the referring resource.
46pub const REFERER: &str = "referer";
47
48/// The HTTP header field name `refresh`, used to specify a time interval for page refresh or redirection.
49pub const REFRESH: &str = "refresh";
50
51/// The HTTP header field name `set-cookie`, used to send cookies from the server to the client.
52pub const SET_COOKIE: &str = "set-cookie";
53
54/// The HTTP header field name `transfer-encoding`, used to specify the form of encoding used to safely transfer the entity to the user.
55pub const TRANSFER_ENCODING: &str = "transfer-encoding";
56
57/// The HTTP header field name `upgrade`, used to indicate the protocol the client wants to upgrade to.
58pub const UPGRADE: &str = "upgrade";
59
60/// The HTTP header field name `sec-websocket-accept`.
61pub const SEC_WEBSOCKET_ACCEPT: &str = "sec-websocket-accept";
62
63/// The HTTP header field name `sec-websocket-key`.
64pub const SEC_WEBSOCKET_KEY: &str = "sec-websocket-key";
65
66/// The HTTP header field name `sec-websocket-protocol`.
67pub const SEC_WEBSOCKET_VERSION: &str = "sec-websocket-version";
68
69/// The HTTP header field name `sec-websocket-protocol`.
70pub const SEC_WEBSOCKET_PROTOCOL: &str = "sec-websocket-protocol";
71
72/// The HTTP header field name `sec-websocket-extensions`.
73pub const SEC_WEBSOCKET_EXTENSIONS: &str = "sec-websocket-extensions";
74
75/// The HTTP header field name `vary`, used to specify that the response may vary based on certain request headers.
76pub const VARY: &str = "vary";
77
78/// The HTTP header field name `x-frame-options`, used to specify whether a browser should be allowed to render a page in a `<frame>`.
79pub const X_FRAME_OPTIONS: &str = "x-frame-options";
80
81/// The HTTP header field name `x-content-type-options`, used to indicate that the browser should not sniff the mime type of a response.
82pub const X_CONTENT_TYPE_OPTIONS: &str = "x-content-type-options";
83
84/// The HTTP header field name `x-powered-by`, used to indicate the technology used by the server.
85pub const X_POWERED_BY: &str = "x-powered-by";
86
87/// The HTTP header field name `x-requested-with`, used to identify the type of request, typically for ajax requests.
88pub const X_REQUESTED_WITH: &str = "x-requested-with";
89
90/// The HTTP header field name `content-length`.
91pub const CONTENT_LENGTH: &str = "content-length";
92
93/// The HTTP header field name `content-encoding`, used to specify the encoding transformations applied to the response body.
94pub const CONTENT_ENCODING: &str = "content-encoding";
95
96/// The HTTP header field name content-type, used to specify the media type of the resource or the data being sent in an http request or response.
97pub const CONTENT_TYPE: &str = "content-type";
98
99/// The HTTP header field `user-agent`.
100pub const USER_AGENT: &str = "user-agent";
101
102/// The HTTP header field `access-control-allow-origin`, used to specify which origins are allowed to access the resource.
103pub const ACCESS_CONTROL_ALLOW_ORIGIN: &str = "access-control-allow-origin";
104
105/// The HTTP header field `access-control-allow-methods`, used to specify The HTTP methods that are allowed when accessing the resource.
106pub const ACCESS_CONTROL_ALLOW_METHODS: &str = "access-control-allow-methods";
107
108/// The HTTP header field `access-control-allow-headers`, used to specify which http headers can be used during the request.
109pub const ACCESS_CONTROL_ALLOW_HEADERS: &str = "access-control-allow-headers";
110
111/// The HTTP header field `expires`, used to specify the date/time after which the response is considered stale.
112pub const EXPIRES: &str = "expires";
113
114/// The HTTP header field `if-match`, used to make a request conditional based on etag values.
115pub const IF_MATCH: &str = "if-match";
116
117/// The HTTP header field `if-none-match`, used to make a request conditional based on etag values.
118pub const IF_NONE_MATCH: &str = "if-none-match";
119
120/// The HTTP header field `if-modified-since`, used to make a request conditional based on timestamps.
121pub const IF_MODIFIED_SINCE: &str = "if-modified-since";
122
123/// The HTTP header field `if-unmodified-since`, used to make a request conditional based on timestamps.
124pub const IF_UNMODIFIED_SINCE: &str = "if-unmodified-since";
125
126/// The HTTP header field `accept-charset`, used to specify which character sets are acceptable.
127pub const ACCEPT_CHARSET: &str = "accept-charset";
128
129/// The HTTP header field `access-control-max-age`, used to indicate how long the results of a preflight request can be cached.
130pub const ACCESS_CONTROL_MAX_AGE: &str = "access-control-max-age";
131
132/// The HTTP header field `access-control-expose-headers`, used to indicate which headers can be exposed as part of the response.
133pub const ACCESS_CONTROL_EXPOSE_HEADERS: &str = "access-control-expose-headers";
134
135/// The HTTP header field `access-control-request-headers`, used in preflight requests to indicate which headers will be used.
136pub const ACCESS_CONTROL_REQUEST_HEADERS: &str = "access-control-request-headers";
137
138/// The HTTP header field `access-control-request-method`, used in preflight requests to indicate which HTTP method will be used.
139pub const ACCESS_CONTROL_REQUEST_METHOD: &str = "access-control-request-method";
140
141/// The HTTP header field `allow`, used to specify supported HTTP methods.
142pub const ALLOW: &str = "allow";
143
144/// The HTTP header field `content-disposition`, used to indicate how the content should be displayed.
145pub const CONTENT_DISPOSITION: &str = "content-disposition";
146
147/// The HTTP header field `content-language`, used to specify the language of the content.
148pub const CONTENT_LANGUAGE: &str = "content-language";
149
150/// The HTTP header field `content-range`, used to indicate where in the full resource this partial message belongs.
151pub const CONTENT_RANGE: &str = "content-range";
152
153/// The HTTP header field `origin`, used to indicate where the cross-origin request originates from.
154pub const ORIGIN: &str = "origin";
155
156/// The HTTP header field `pragma`, used to include implementation-specific directives.
157pub const PRAGMA: &str = "pragma";
158
159/// The HTTP header field `proxy-authenticate`, used in responses from a proxy to indicate authentication is required.
160pub const PROXY_AUTHENTICATE: &str = "proxy-authenticate";
161
162/// The HTTP header field `proxy-authorization`, used to authenticate with a proxy server.
163pub const PROXY_AUTHORIZATION: &str = "proxy-authorization";
164
165/// The HTTP header field `retry-after`, used to indicate how long to wait before making a new request.
166pub const RETRY_AFTER: &str = "retry-after";
167
168/// The HTTP header field `strict-transport-security`, used to specify that the browser should only connect using HTTPS.
169pub const STRICT_TRANSPORT_SECURITY: &str = "strict-transport-security";
170
171/// The HTTP header field `www-authenticate`, used to indicate the authentication scheme.
172pub const WWW_AUTHENTICATE: &str = "www-authenticate";
173
174/// The HTTP header field `x-api-key`, used to specify an API key for authentication.
175pub const X_API_KEY: &str = "x-api-key";
176
177/// The HTTP header field `x-auth-token`, used to specify an authentication token.
178pub const X_AUTH_TOKEN: &str = "x-auth-token";
179
180/// The HTTP/2 pseudo-header field `:authority`, used to specify the authority portion of the target URI.
181pub const COLON_AUTHORITY: &str = ":authority";
182
183/// The HTTP/2 pseudo-header field `:method`, used to specify the HTTP method.
184pub const COLON_METHOD: &str = ":method";
185
186/// The HTTP/2 pseudo-header field `:path`, used to specify the path and query parts of the target URI.
187pub const COLON_PATH: &str = ":path";
188
189/// The HTTP/2 pseudo-header field `:scheme`, used to specify the scheme portion of the target URI.
190pub const COLON_SCHEME: &str = ":scheme";
191
192/// The HTTP header field `priority`, used to indicate the priority of the request.
193pub const PRIORITY: &str = "priority";
194
195/// The HTTP header field `sec-ch-ua`, used to indicate the user agent's brand and version.
196pub const SEC_CH_UA: &str = "sec-ch-ua";
197
198/// The HTTP header field `sec-ch-ua-mobile`, used to indicate whether the user agent is running on a mobile device.
199pub const SEC_CH_UA_MOBILE: &str = "sec-ch-ua-mobile";
200
201/// The HTTP header field `sec-ch-ua-platform`, used to indicate the platform the user agent is running on.
202pub const SEC_CH_UA_PLATFORM: &str = "sec-ch-ua-platform";
203
204/// The HTTP header field `sec-fetch-dest`, used to indicate the destination of the request.
205pub const SEC_FETCH_DEST: &str = "sec-fetch-dest";
206
207/// The HTTP header field `sec-fetch-mode`, used to indicate the mode of the request.
208pub const SEC_FETCH_MODE: &str = "sec-fetch-mode";
209
210/// The HTTP header field `sec-fetch-site`, used to indicate the relationship between the request initiator's origin and the origin of the requested resource.
211pub const SEC_FETCH_SITE: &str = "sec-fetch-site";
212
213/// The HTTP header field `age`, used to indicate the age of the response in seconds.
214pub const AGE: &str = "age";
215
216/// The HTTP header field `alt-svc`, used to advertise alternative services through which the same resource can be reached.
217pub const ALT_SVC: &str = "alt-svc";
218
219/// The HTTP header field `expect`, used to indicate expectations that need to be fulfilled by the server.
220pub const EXPECT: &str = "expect";
221
222/// The HTTP header field `forwarded`, used to disclose original information of a client connecting to a web server through an HTTP proxy.
223pub const FORWARDED: &str = "forwarded";
224
225/// The HTTP header field `from`, used to specify an Internet email address for a human user.
226pub const FROM: &str = "from";
227
228/// The HTTP header field `link`, used to specify relationships between resources.
229pub const LINK: &str = "link";
230
231/// The HTTP header field `max-forwards`, used to limit the number of times a message can be forwarded through proxies or gateways.
232pub const MAX_FORWARDS: &str = "max-forwards";
233
234/// The HTTP header field `range`, used to specify the range of a resource to be retrieved.
235pub const RANGE: &str = "range";
236
237/// The HTTP header field `te`, used to specify which transfer encodings the user agent is willing to accept.
238pub const TE: &str = "te";
239
240/// The HTTP header field `via`, used to indicate the intermediate protocols and recipients between the user agent and the server.
241pub const VIA: &str = "via";
242
243/// The HTTP header field `dnt`, used to specify the user's tracking preference.
244pub const DNT: &str = "dnt";
245
246/// The HTTP header field `sec-fetch-user`, used to indicate whether the request was triggered by a user activation.
247pub const SEC_FETCH_USER: &str = "sec-fetch-user";
248
249/// The HTTP header field `accept-ranges`, used to specify the range units that can be accepted.
250pub const ACCEPT_RANGES: &str = "accept-ranges";
251
252/// The HTTP header field `content-md5`, used to specify the MD5 checksum of the entity-body.
253pub const CONTENT_MD5: &str = "content-md5";
254
255/// The HTTP header field `content-location`, used to specify the location of the resource.
256pub const CONTENT_LOCATION: &str = "content-location";
257
258/// The HTTP header field `content-security-policy`, used to specify the security policy of the resource.
259pub const CONTENT_SECURITY_POLICY: &str = "content-security-policy";
260
261/// The HTTP header field `content-security-policy-report-only`, used to specify the security policy of the resource.
262pub const CONTENT_SECURITY_POLICY_REPORT_ONLY: &str = "content-security-policy-report-only";
263
264/// The HTTP header field `content-security-policy-report`, used to specify the security policy of the resource.
265pub const CONTENT_SECURITY_POLICY_REPORT: &str = "content-security-policy-report";
266
267/// The HTTP header field `content-security-policy-report-to`, used to specify the security policy of the resource.
268pub const CONTENT_SECURITY_POLICY_REPORT_TO: &str = "content-security-policy-report-to";
269
270/// The HTTP header field `content-security-policy-report-uri`, used to specify the security policy of the resource.
271pub const CONTENT_SECURITY_POLICY_REPORT_URI: &str = "content-security-policy-report-uri";
272
273/// The HTTP header field `x-forwarded-for`, used to identify the originating IP address of a client connecting through a proxy.
274pub const X_FORWARDED_FOR: &str = "x-forwarded-for";
275
276/// The HTTP header field `x-forwarded-host`, used to identify the original host requested by the client.
277pub const X_FORWARDED_HOST: &str = "x-forwarded-host";
278
279/// The HTTP header field `x-forwarded-proto`, used to identify the protocol used by the client to connect to the proxy.
280pub const X_FORWARDED_PROTO: &str = "x-forwarded-proto";
281
282/// The HTTP header field `x-forwarded-port`, used to identify the port used by the client to connect to the proxy.
283pub const X_FORWARDED_PORT: &str = "x-forwarded-port";
284
285/// The HTTP header field `x-real-ip`, used to identify the real IP address of the client.
286pub const X_REAL_IP: &str = "x-real-ip";
287
288/// The HTTP header field `x-request-id`, used to identify the request for tracing purposes.
289pub const X_REQUEST_ID: &str = "x-request-id";
290
291/// The HTTP header field `x-correlation-id`, used to correlate requests across services.
292pub const X_CORRELATION_ID: &str = "x-correlation-id";
293
294/// The HTTP header field `x-trace-id`, used to trace requests across distributed systems.
295pub const X_TRACE_ID: &str = "x-trace-id";
296
297/// The HTTP header field `accept-patch`, used to specify which patch document formats are accepted.
298pub const ACCEPT_PATCH: &str = "accept-patch";
299
300/// The HTTP header field `if-range`, used to make a range request conditional.
301pub const IF_RANGE: &str = "if-range";
302
303/// The HTTP header field `warning`, used to carry additional information about the status of a response.
304pub const WARNING_HEADER: &str = "warning";
305
306/// The HTTP header field `upgrade-insecure-requests`, used to signal the server that the client prefers encrypted responses.
307pub const UPGRADE_INSECURE_REQUESTS: &str = "upgrade-insecure-requests";
308
309/// The HTTP header field `x-xss-protection`, used to enable XSS filtering in browsers.
310pub const X_XSS_PROTECTION: &str = "x-xss-protection";
311
312/// The HTTP header field `referrer-policy`, used to control how much referrer information is included with requests.
313pub const REFERRER_POLICY: &str = "referrer-policy";
314
315/// The HTTP header field `feature-policy`, used to control which browser features can be used.
316pub const FEATURE_POLICY: &str = "feature-policy";
317
318/// The HTTP header field `permissions-policy`, used to control which browser features can be used.
319pub const PERMISSIONS_POLICY: &str = "permissions-policy";
320
321/// The HTTP header field `cross-origin-embedder-policy`, used to prevent a document from loading cross-origin resources.
322pub const CROSS_ORIGIN_EMBEDDER_POLICY: &str = "cross-origin-embedder-policy";
323
324/// The HTTP header field `cross-origin-opener-policy`, used to ensure a top-level document does not share a browsing context group.
325pub const CROSS_ORIGIN_OPENER_POLICY: &str = "cross-origin-opener-policy";
326
327/// The HTTP header field `cross-origin-resource-policy`, used to convey a desire that the browser blocks no-cors cross-origin requests.
328pub const CROSS_ORIGIN_RESOURCE_POLICY: &str = "cross-origin-resource-policy";
329
330/// The HTTP header field `timing-allow-origin`, used to specify origins that are allowed to see timing information.
331pub const TIMING_ALLOW_ORIGIN: &str = "timing-allow-origin";
332
333/// The HTTP header field `server-timing`, used to communicate performance metrics about the request-response cycle.
334pub const SERVER_TIMING: &str = "server-timing";
335
336/// The HTTP header field `clear-site-data`, used to clear browsing data associated with the requesting website.
337pub const CLEAR_SITE_DATA: &str = "clear-site-data";
338
339/// The HTTP header field `early-data`, used to indicate that the request was sent in TLS early data.
340pub const EARLY_DATA: &str = "early-data";
341
342/// The HTTP header field `accept-post`, used to specify which media types are accepted for POST requests.
343pub const ACCEPT_POST: &str = "accept-post";
344
345/// The HTTP header field `access-control-allow-credentials`, used to indicate whether credentials can be exposed.
346pub const ACCESS_CONTROL_ALLOW_CREDENTIALS: &str = "access-control-allow-credentials";
347
348/// The HTTP header field `nel`, used to define a network error logging policy.
349pub const NEL: &str = "nel";
350
351/// The HTTP header field `report-to`, used to specify endpoints for reporting.
352pub const REPORT_TO: &str = "report-to";
353
354/// The HTTP header field `sourcemap`, used to specify the URL of the source map for a JavaScript file.
355pub const SOURCEMAP: &str = "sourcemap";
356
357/// The HTTP header field `x-dns-prefetch-control`, used to control DNS prefetching.
358pub const X_DNS_PREFETCH_CONTROL: &str = "x-dns-prefetch-control";
359
360/// The HTTP header field `x-download-options`, used to prevent file downloads from being executed.
361pub const X_DOWNLOAD_OPTIONS: &str = "x-download-options";
362
363/// The HTTP header field `x-permitted-cross-domain-policies`, used to control cross-domain policy files.
364pub const X_PERMITTED_CROSS_DOMAIN_POLICIES: &str = "x-permitted-cross-domain-policies";
365
366/// The HTTP header field `x-robots-tag`, used to control how search engines index content.
367pub const X_ROBOTS_TAG: &str = "x-robots-tag";
368
369/// The HTTP header field `x-ua-compatible`, used to specify which version of Internet Explorer the page should be rendered as.
370pub const X_UA_COMPATIBLE: &str = "x-ua-compatible";
371
372/// The HTTP header field `cdn-loop`, used to prevent CDN loops.
373pub const CDN_LOOP: &str = "cdn-loop";
374
375/// The HTTP header field `cf-connecting-ip`, used by Cloudflare to indicate the client IP address.
376pub const CF_CONNECTING_IP: &str = "cf-connecting-ip";
377
378/// The HTTP header field `cf-ray`, used by Cloudflare to identify the request.
379pub const CF_RAY: &str = "cf-ray";
380
381/// The HTTP header field `cf-visitor`, used by Cloudflare to indicate the scheme used by the client.
382pub const CF_VISITOR: &str = "cf-visitor";
383
384/// The HTTP header field `true-client-ip`, used by some CDNs to indicate the real client IP address.
385pub const TRUE_CLIENT_IP: &str = "true-client-ip";
386
387/// The HTTP header field `proxy-connection`, used to specify the connection used to connect to the proxy.
388pub const PROXY_CONNECTION: &str = "proxy-connection";
389
390/// The HTTP header field `transfer-encoding`, used to specify the form of encoding used to safely transfer the entity to the user.
391pub const HTTP2_FORBIDDEN_HEADERS: [&str; 5] = [
392    CONNECTION,
393    KEEP_ALIVE,
394    PROXY_CONNECTION,
395    TRANSFER_ENCODING,
396    UPGRADE,
397];
398
399/// The HTTP header field `socket-address`.
400pub const SOCKET_ADDRESS: &str = "socket-address";
401
402/// The HTTP header field `token`, used for authentication purposes.
403pub const TOKEN: &str = "token";