未验证 提交 d1456e3a 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #34993 from schuetzm/allow-subdomains-of-localhost

Subdomains of localhost are safe against DNS rebinding
......@@ -30,7 +30,7 @@ def initialize(*)
@filter_parameters = []
@filter_redirect = []
@helpers_paths = []
@hosts = Array(([IPAddr.new("0.0.0.0/0"), IPAddr.new("::/0"), "localhost"] if Rails.env.development?))
@hosts = Array(([IPAddr.new("0.0.0.0/0"), IPAddr.new("::/0"), ".localhost"] if Rails.env.development?))
@public_file_server = ActiveSupport::OrderedOptions.new
@public_file_server.enabled = true
@public_file_server.index_name = "index"
......
......@@ -2289,6 +2289,11 @@ class MyLogger < ::Logger
MESSAGE
end
test "the host whitelist includes .localhost in development" do
app "development"
assert_includes Rails.application.config.hosts, ".localhost"
end
private
def force_lazy_load_hooks
yield # Tasty clarifying sugar, homie! We only need to reference a constant to load it.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册