pub async fn security_headers_middleware(
request: Request<Body>,
next: Next,
) -> Response<Body>Expand description
Security headers middleware.
Adds the following headers to all responses:
X-Content-Type-Options: nosniffX-Frame-Options: DENYX-XSS-Protection: 0(modern best practice - rely on CSP instead)Referrer-Policy: strict-origin-when-cross-originContent-Security-Policy: default-src 'none'; frame-ancestors 'none'Cache-Control: no-store(API responses should not be cached)