Remove exclude option from ActionDispatch::SSL

上级 09d884cd
......@@ -13,14 +13,11 @@ def initialize(app, options = {})
@hsts = {} if @hsts == true
@hsts = self.class.default_hsts_options.merge(@hsts) if @hsts
@exclude = options[:exclude]
@host = options[:host]
@port = options[:port]
end
def call(env)
return @app.call(env) if exclude?(env)
request = Request.new(env)
if request.ssl?
......@@ -34,10 +31,6 @@ def call(env)
end
private
def exclude?(env)
@exclude && @exclude.call(env)
end
def redirect_to_https(request)
url = URI(request.url)
url.scheme = "https"
......
......@@ -31,12 +31,6 @@ def test_redirects_http_to_https
response.headers['Location']
end
def test_exclude_from_redirect
self.app = ActionDispatch::SSL.new(default_app, :exclude => lambda { |env| true })
get "http://example.org/"
assert_response :success
end
def test_hsts_header_by_default
get "https://example.org/"
assert_equal "max-age=31536000",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册