HSTS for Rust with Actix-web: Copy-Paste Reference
HTTP Strict Transport Security is one of those headers that’s simple, powerful, and easy to get subtly wrong. If you’re serving a Rust app with Actix-web, HSTS usually comes down to one header: Strict-Transport-Security: max-age=31536000; includeSubDomains That header tells browsers: “For this domain, always use HTTPS for the next year.” Once a browser sees it over a valid HTTPS connection, it will refuse to use plain HTTP for that site until the policy expires. ...