pub struct MiddlewareHeaders {Show 33 fields
pub access_control_allow_credentials: Option<bool>,
pub access_control_allow_headers: Option<Vec<String>>,
pub access_control_allow_methods: Option<Vec<String>>,
pub access_control_allow_origin_list: Option<Vec<String>>,
pub access_control_allow_origin_list_regex: Option<Vec<String>>,
pub access_control_expose_headers: Option<Vec<String>>,
pub access_control_max_age: Option<i64>,
pub add_vary_header: Option<bool>,
pub allowed_hosts: Option<Vec<String>>,
pub browser_xss_filter: Option<bool>,
pub content_security_policy: Option<String>,
pub content_security_policy_report_only: Option<String>,
pub content_type_nosniff: Option<bool>,
pub custom_browser_xss_value: Option<String>,
pub custom_frame_options_value: Option<String>,
pub custom_request_headers: Option<BTreeMap<String, String>>,
pub custom_response_headers: Option<BTreeMap<String, String>>,
pub feature_policy: Option<String>,
pub force_sts_header: Option<bool>,
pub frame_deny: Option<bool>,
pub hosts_proxy_headers: Option<Vec<String>>,
pub is_development: Option<bool>,
pub permissions_policy: Option<String>,
pub public_key: Option<String>,
pub referrer_policy: Option<String>,
pub ssl_force_host: Option<bool>,
pub ssl_host: Option<String>,
pub ssl_proxy_headers: Option<BTreeMap<String, String>>,
pub ssl_redirect: Option<bool>,
pub ssl_temporary_redirect: Option<bool>,
pub sts_include_subdomains: Option<bool>,
pub sts_preload: Option<bool>,
pub sts_seconds: Option<i64>,
}
Expand description
Headers holds the headers middleware configuration. This middleware manages the requests and responses headers. More info: https://doc.traefik.io/traefik/v3.3/middlewares/http/headers/#customrequestheaders
Fields§
§access_control_allow_credentials: Option<bool>
AccessControlAllowCredentials defines whether the request can include user credentials.
access_control_allow_headers: Option<Vec<String>>
AccessControlAllowHeaders defines the Access-Control-Request-Headers values sent in preflight response.
access_control_allow_methods: Option<Vec<String>>
AccessControlAllowMethods defines the Access-Control-Request-Method values sent in preflight response.
access_control_allow_origin_list: Option<Vec<String>>
AccessControlAllowOriginList is a list of allowable origins. Can also be a wildcard origin “*”.
access_control_allow_origin_list_regex: Option<Vec<String>>
AccessControlAllowOriginListRegex is a list of allowable origins written following the Regular Expression syntax (https://golang.org/pkg/regexp/).
access_control_expose_headers: Option<Vec<String>>
AccessControlExposeHeaders defines the Access-Control-Expose-Headers values sent in preflight response.
access_control_max_age: Option<i64>
AccessControlMaxAge defines the time that a preflight request may be cached.
add_vary_header: Option<bool>
AddVaryHeader defines whether the Vary header is automatically added/updated when the AccessControlAllowOriginList is set.
allowed_hosts: Option<Vec<String>>
AllowedHosts defines the fully qualified list of allowed domain names.
browser_xss_filter: Option<bool>
BrowserXSSFilter defines whether to add the X-XSS-Protection header with the value 1; mode=block.
content_security_policy: Option<String>
ContentSecurityPolicy defines the Content-Security-Policy header value.
content_security_policy_report_only: Option<String>
ContentSecurityPolicyReportOnly defines the Content-Security-Policy-Report-Only header value.
content_type_nosniff: Option<bool>
ContentTypeNosniff defines whether to add the X-Content-Type-Options header with the nosniff value.
custom_browser_xss_value: Option<String>
CustomBrowserXSSValue defines the X-XSS-Protection header value. This overrides the BrowserXssFilter option.
custom_frame_options_value: Option<String>
CustomFrameOptionsValue defines the X-Frame-Options header value. This overrides the FrameDeny option.
custom_request_headers: Option<BTreeMap<String, String>>
CustomRequestHeaders defines the header names and values to apply to the request.
custom_response_headers: Option<BTreeMap<String, String>>
CustomResponseHeaders defines the header names and values to apply to the response.
feature_policy: Option<String>
Deprecated: FeaturePolicy option is deprecated, please use PermissionsPolicy instead.
force_sts_header: Option<bool>
ForceSTSHeader defines whether to add the STS header even when the connection is HTTP.
frame_deny: Option<bool>
FrameDeny defines whether to add the X-Frame-Options header with the DENY value.
hosts_proxy_headers: Option<Vec<String>>
HostsProxyHeaders defines the header keys that may hold a proxied hostname value for the request.
is_development: Option<bool>
IsDevelopment defines whether to mitigate the unwanted effects of the AllowedHosts, SSL, and STS options when developing. Usually testing takes place using HTTP, not HTTPS, and on localhost, not your production domain. If you would like your development environment to mimic production with complete Host blocking, SSL redirects, and STS headers, leave this as false.
permissions_policy: Option<String>
PermissionsPolicy defines the Permissions-Policy header value. This allows sites to control browser features.
public_key: Option<String>
PublicKey is the public key that implements HPKP to prevent MITM attacks with forged certificates.
referrer_policy: Option<String>
ReferrerPolicy defines the Referrer-Policy header value. This allows sites to control whether browsers forward the Referer header to other sites.
ssl_force_host: Option<bool>
Deprecated: SSLForceHost option is deprecated, please use RedirectRegex instead.
ssl_host: Option<String>
Deprecated: SSLHost option is deprecated, please use RedirectRegex instead.
ssl_proxy_headers: Option<BTreeMap<String, String>>
SSLProxyHeaders defines the header keys with associated values that would indicate a valid HTTPS request. It can be useful when using other proxies (example: “X-Forwarded-Proto”: “https”).
ssl_redirect: Option<bool>
Deprecated: SSLRedirect option is deprecated, please use EntryPoint redirection or RedirectScheme instead.
ssl_temporary_redirect: Option<bool>
Deprecated: SSLTemporaryRedirect option is deprecated, please use EntryPoint redirection or RedirectScheme instead.
sts_include_subdomains: Option<bool>
STSIncludeSubdomains defines whether the includeSubDomains directive is appended to the Strict-Transport-Security header.
sts_preload: Option<bool>
STSPreload defines whether the preload flag is appended to the Strict-Transport-Security header.
sts_seconds: Option<i64>
STSSeconds defines the max-age of the Strict-Transport-Security header. If set to 0, the header is not set.
Implementations§
Source§impl MiddlewareHeaders
impl MiddlewareHeaders
Sourcepub fn builder() -> MiddlewareHeadersBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> MiddlewareHeadersBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building MiddlewareHeaders
.
On the builder, call .access_control_allow_credentials(...)
(optional), .access_control_allow_headers(...)
(optional), .access_control_allow_methods(...)
(optional), .access_control_allow_origin_list(...)
(optional), .access_control_allow_origin_list_regex(...)
(optional), .access_control_expose_headers(...)
(optional), .access_control_max_age(...)
(optional), .add_vary_header(...)
(optional), .allowed_hosts(...)
(optional), .browser_xss_filter(...)
(optional), .content_security_policy(...)
(optional), .content_security_policy_report_only(...)
(optional), .content_type_nosniff(...)
(optional), .custom_browser_xss_value(...)
(optional), .custom_frame_options_value(...)
(optional), .custom_request_headers(...)
(optional), .custom_response_headers(...)
(optional), .feature_policy(...)
(optional), .force_sts_header(...)
(optional), .frame_deny(...)
(optional), .hosts_proxy_headers(...)
(optional), .is_development(...)
(optional), .permissions_policy(...)
(optional), .public_key(...)
(optional), .referrer_policy(...)
(optional), .ssl_force_host(...)
(optional), .ssl_host(...)
(optional), .ssl_proxy_headers(...)
(optional), .ssl_redirect(...)
(optional), .ssl_temporary_redirect(...)
(optional), .sts_include_subdomains(...)
(optional), .sts_preload(...)
(optional), .sts_seconds(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MiddlewareHeaders
.
Trait Implementations§
Source§impl Clone for MiddlewareHeaders
impl Clone for MiddlewareHeaders
Source§fn clone(&self) -> MiddlewareHeaders
fn clone(&self) -> MiddlewareHeaders
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MiddlewareHeaders
impl Debug for MiddlewareHeaders
Source§impl Default for MiddlewareHeaders
impl Default for MiddlewareHeaders
Source§fn default() -> MiddlewareHeaders
fn default() -> MiddlewareHeaders
Source§impl<'de> Deserialize<'de> for MiddlewareHeaders
impl<'de> Deserialize<'de> for MiddlewareHeaders
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MiddlewareHeaders
impl JsonSchema for MiddlewareHeaders
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for MiddlewareHeaders
impl PartialEq for MiddlewareHeaders
Source§impl Serialize for MiddlewareHeaders
impl Serialize for MiddlewareHeaders
impl StructuralPartialEq for MiddlewareHeaders
Auto Trait Implementations§
impl Freeze for MiddlewareHeaders
impl RefUnwindSafe for MiddlewareHeaders
impl Send for MiddlewareHeaders
impl Sync for MiddlewareHeaders
impl Unpin for MiddlewareHeaders
impl UnwindSafe for MiddlewareHeaders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more