2

Assuming the following, what domain will be HSTS'ed for the next year, foo.com or bar.com? RTFM (RFC6797) doesn't help much.

> GET / HTTP/1.1
> Host: foo.com
[ ... ]
< HTTP/1.1 301 Moved Permanently
< Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
< Location: https://bar.com
  • Technically it depends on the header sent when contacting second website (bad obfuscation, you should have used the .example TLD instead): maybe the second website also use HSTS with the same headers. But in general MAximillian answer holds: the header protects the ongoing HTTP exchange so applies to the website you are connecting too, whatever happens after the connection (error, serving local page, proxying, redirecting, etc.) – Patrick Mevzek Dec 17 '18 at 19:06
2

The HSTS will apply to foo.com. HSTS always applies to the server serving the response itself.

If you think about it, if it worked the other way then people could set HSTS on each other's sites, which would be a big mess.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.