pub struct MiddlewareHeaders {
Show 27 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_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 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_proxy_headers: Option<BTreeMap<String, String>>, 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.0/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_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.

§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_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”).

§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.

Trait Implementations§

source§

impl Clone for MiddlewareHeaders

source§

fn clone(&self) -> MiddlewareHeaders

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MiddlewareHeaders

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MiddlewareHeaders

source§

fn default() -> MiddlewareHeaders

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for MiddlewareHeaders

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for MiddlewareHeaders

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl Serialize for MiddlewareHeaders

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,