Skip to main content

Module security

Module security 

Source
Available on crate feature security only.
Expand description

Middleware to add security headers to every response.

Wrap the app with SecurityHeader::default().build() and customize fields or enable HSTS (see SecurityHeader::set_default_hsts) as needed.

Structs§

SecurityHeader
Security headers applied to every response by SecurityHeader::build.

Enums§

CrossOriginOpenerPolicy
Value of the Cross-Origin-Opener-Policy header.
RefererPolicy
Value of the Referrer-Policy header.
StrictTransportSecurity
Value of the Strict-Transport-Security (HSTS) header. The payload is max-age in seconds; variants add the includeSubDomains / preload directives.
XFrameOptions
Value of the X-Frame-Options header.