Honor HSTS only after a valid HTTPS response establishes policy
A user agent establishes or updates dynamic HSTS state only from a valid Strict-Transport-Security field received over error-free secure transport and ignores the field over insecure HTTP.
Read the explainer