pub struct SecurityHeadersConfig {
pub extra_script_src: Vec<String>,
pub relaxed_csp_path_prefix: String,
pub include_permissions_policy: bool,
}Expand description
Configuration for the security headers middleware.
Fields§
§extra_script_src: Vec<String>Additional script-src origins to include in CSP (e.g. "https://cdn.jsdelivr.net").
Applied to paths matching relaxed_csp_path_prefix.
relaxed_csp_path_prefix: StringPath prefix that triggers the relaxed CSP with extra_script_src.
Defaults to "/docs" if empty.
include_permissions_policy: boolWhether to include the Permissions-Policy header.
Trait Implementations§
Source§impl Clone for SecurityHeadersConfig
impl Clone for SecurityHeadersConfig
Source§fn clone(&self) -> SecurityHeadersConfig
fn clone(&self) -> SecurityHeadersConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SecurityHeadersConfig
impl Debug for SecurityHeadersConfig
Auto Trait Implementations§
impl Freeze for SecurityHeadersConfig
impl RefUnwindSafe for SecurityHeadersConfig
impl Send for SecurityHeadersConfig
impl Sync for SecurityHeadersConfig
impl Unpin for SecurityHeadersConfig
impl UnsafeUnpin for SecurityHeadersConfig
impl UnwindSafe for SecurityHeadersConfig
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
Mutably borrows from an owned value. Read more