HSTS in FastAPI: Options, Tradeoffs, and Safe Defaults
HSTS in FastAPI is one of those things that looks trivial until you ship it wrong. The header itself is simple: Strict-Transport-Security: max-age=31536000; includeSubDomains But the decision around where to set it, when to enable it, and whether to preload it can absolutely break local development, staging subdomains, and legacy services you forgot still exist. If you run FastAPI in production, you want HSTS. The real question is which implementation path fits your stack. ...