HSTS for Dart with Shelf: Copy-Paste Reference

HTTP Strict Transport Security is one of those headers you set once, then forget about until you realize your rollout plan was sloppy. If you run a Dart app with Shelf, HSTS is straightforward: send a Strict-Transport-Security response header on HTTPS responses, and don’t break local development while doing it. This guide is the practical version: what to send, when to send it, and copy-paste Shelf middleware you can actually use. ...

April 28, 2026 · 7 min · headertest.com

HSTS for Fastify: Options, Tradeoffs, and Safe Rollout

HSTS looks simple: send one response header and browsers stop talking to your site over plain HTTP. The catch is that HSTS is one of those headers that can absolutely improve security and absolutely break things if you roll it out carelessly. I’ve seen teams flip on includeSubDomains in production and then spend the afternoon finding forgotten subdomains, old staging boxes, and random vendor callbacks still using HTTP. If you’re running Fastify, you’ve got a few ways to handle HSTS: ...

April 23, 2026 · 7 min · headertest.com

HSTS for Node.js with Koa: Copy-Paste Reference

HSTS is one of those headers that looks trivial until you ship it wrong. For Koa apps, the mechanics are easy: send Strict-Transport-Security over HTTPS. The hard part is rollout, preload, proxies, subdomains, and not bricking a staging or legacy setup by accident. This guide is the version I wish more teams had on hand: what to send, when to send it, and copy-paste Koa examples that won’t surprise you later. ...

April 20, 2026 · 7 min · headertest.com

HSTS and Certificate Management: A Real-World Fix

A few years ago, I helped clean up a messy HTTPS rollout for a mid-sized SaaS app. On paper, the setup looked fine: valid TLS cert, HTTPS redirect, load balancer in front, and a decent-looking security checklist in the wiki. In production, it was shaky. Users could still hit http:// directly. Some static assets loaded from old subdomains with mismatched certificates. One internal team wanted to turn on HSTS preload immediately because they’d read that “preload means maximum security.” That would have been a great way to lock broken TLS behavior into every browser. ...

April 18, 2026 · 6 min · headertest.com

HSTS for Crystal with Kemal: Pros, Cons, and Setup

HSTS is one of those headers that’s boring right up until the day it saves you from a nasty downgrade or cookie theft issue. If you’re running a Crystal app with Kemal, HSTS is usually easy to add. The hard part is deciding how aggressive to be. Short max-age? Long max-age? Include subdomains? Preload? Those choices have real operational consequences, especially if you run staging environments, legacy subdomains, or mixed infrastructure. ...

April 16, 2026 · 6 min · headertest.com

HSTS for Scala with Play Framework: Pros, Cons, Setup

If you run a Play app in production and you’re still treating HTTPS as “mostly enabled,” HSTS is one of the easiest ways to stop users from ever hitting your site over plain HTTP again. The idea is simple: tell the browser, “for this domain, only use HTTPS for a while.” After that, even if someone clicks an old http:// link or a network attacker tries SSL stripping, the browser upgrades the request before it leaves the machine. ...

April 14, 2026 · 7 min · headertest.com

HSTS Mistakes in Erlang Cowboy and How to Fix Them

HSTS looks simple: send one response header and browsers stop using HTTP for your site. In practice, teams still get it wrong all the time, especially in Erlang systems sitting behind load balancers, reverse proxies, or mixed legacy setups. I’ve seen Cowboy apps ship with “secure” configs that quietly do nothing, break subdomains, or lock a bad decision into browsers for months. If you’re running Cowboy, the tricky part usually isn’t the header syntax. It’s where you set it, when you set it, and whether your deployment actually matches what the browser thinks is happening. ...

April 13, 2026 · 7 min · headertest.com

HSTS in Rocket: A Real-World Rust Hardening Case Study

A few years ago I helped clean up a small Rust service that had all the usual “we’ll fix it before launch” security leftovers. The app used Rocket. TLS was terminated at a reverse proxy. Redirects from HTTP to HTTPS were working. Cookies were marked Secure. Everyone on the team assumed transport security was done. It wasn’t. The missing piece was HSTS: Strict-Transport-Security. Without it, first requests were still vulnerable to downgrade tricks, bad links, stale bookmarks, and users typing example.com without the scheme. The site looked secure in normal testing, but the browser had no instruction to always use HTTPS on future visits. ...

April 11, 2026 · 7 min · headertest.com

HSTS in Swift Vapor: Secure HTTPS the Right Way

If you’re shipping a Vapor app over HTTPS and you haven’t enabled HSTS yet, you’re leaving a pretty dumb gap in your transport security. HSTS stands for HTTP Strict Transport Security. It tells browsers: “for this domain, stop trying plain HTTP and always use HTTPS.” That matters because a redirect from http:// to https:// is not enough. An attacker sitting on the network can tamper with that first insecure request before the browser ever gets redirected. ...

April 9, 2026 · 7 min · headertest.com

HSTS for Go with Gin: Pros, Cons, and Setup

If you run a Gin app over HTTPS and you’re not sending HSTS, you’re leaving an easy downgrade path open. HSTS tells browsers: “stop trying plain HTTP for this site; always use HTTPS.” That shuts down a bunch of avoidable mistakes and some very real attack paths. The catch: HSTS is one of those headers that looks trivial but can absolutely bite you in production if you roll it out carelessly. I’ve seen teams turn it on with preload flags before they were ready, then spend days untangling broken subdomains and internal tools. ...

April 4, 2026 · 7 min · headertest.com