NODE249 // TOOLSLAB/002 · EXPERIMENTES

LEARN · HSTS

HSTS (Strict-Transport-Security)

What HSTS is, which max-age to use and how to enable it without breaking your site.

WHAT IT IS

HSTS is a header telling the browser: "from now on, connect to this site only over HTTPS for X seconds". The browser never tries http:// again.

WHY IT MATTERS

It prevents an attacker on a network (public Wi-Fi, for example) from downgrading the connection to http:// on the first request of each visit.

COMMON MISTAKES

EXAMPLE

Strict-Transport-Security: max-age=31536000; includeSubDomains

HOW WE CHECK IT