提交 6eb3a1b0 编写于 作者: E Egor Homakov 提交者: Prathamesh Sonpatki

HSTS without IncludeSubdomains is often useless

1) Because if you forget to add Secure; to the session cookie, it will leak to http:// subdomain in some cases
2) Because http:// subdomain can Cookie Bomb/cookie force main domain or be used for phishing.

That's why *by default* it must include subdomains as it's much more common scenario. Very few websites *intend* to leave their blog.app.com working over http:// while having everything else encrypted. 

Yes, many developers forget to add subdomains=true by default, believe me :)
上级 50e4433b
......@@ -40,7 +40,7 @@ class SSL
HSTS_EXPIRES_IN = 15552000
def self.default_hsts_options
{ expires: HSTS_EXPIRES_IN, subdomains: false, preload: false }
{ expires: HSTS_EXPIRES_IN, subdomains: true, preload: false }
end
def initialize(app, redirect: {}, hsts: {}, secure_cookies: true, **options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册