默认情况下,spring security(4.0.1.Release)将HSTS主机设置为https协议,您可以在响应头中看到Strict-Transport-Security: max-age=31536000 ;
(我使用Firefox> Web Development> Network)。
但是当我查看firefox控制台时,看到一个错误消息:The site specified an invalid Strict-Transport-Security header.
我还在spring config中手动将hsts标头设置为:
<headers>
<hsts />
</headers>
生成相同的响应头,并且FireFox再次显示错误。
根据https://developer.mozilla.org/docs/Security/HTTP_Strict_Transport_Security,标题必须正确!
有任何评论吗?!