Skip to main content

io_http/rfc9110/
headers.rs

1//! Common HTTP header name constants ([RFC 9110 §5]), lowercase.
2//!
3//! [RFC 9110 §5]: https://www.rfc-editor.org/rfc/rfc9110#section-5
4
5/// Header names whose values are redacted in [`core::fmt::Debug`] output.
6pub const HTTP_SENSITIVE_HEADERS: &[&str] = &[
7    HTTP_AUTHORIZATION,
8    HTTP_PROXY_AUTHORIZATION,
9    HTTP_COOKIE,
10    HTTP_SET_COOKIE,
11    HTTP_WWW_AUTHENTICATE,
12    HTTP_PROXY_AUTHENTICATE,
13];
14
15/// The authorization request header name.
16pub const HTTP_AUTHORIZATION: &str = "authorization";
17/// The connection header name.
18pub const HTTP_CONNECTION: &str = "connection";
19/// The content length header name.
20pub const HTTP_CONTENT_LENGTH: &str = "content-length";
21/// The cookie request header name.
22pub const HTTP_COOKIE: &str = "cookie";
23/// The host request header name.
24pub const HTTP_HOST: &str = "host";
25/// The location response header name.
26pub const HTTP_LOCATION: &str = "location";
27/// The proxy authenticate response header name.
28pub const HTTP_PROXY_AUTHENTICATE: &str = "proxy-authenticate";
29/// The proxy authorization request header name.
30pub const HTTP_PROXY_AUTHORIZATION: &str = "proxy-authorization";
31/// The set-cookie response header name.
32pub const HTTP_SET_COOKIE: &str = "set-cookie";
33/// The transfer encoding header name.
34pub const HTTP_TRANSFER_ENCODING: &str = "transfer-encoding";
35/// The authenticate response header name.
36pub const HTTP_WWW_AUTHENTICATE: &str = "www-authenticate";