1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove exclude option from ActionDispatch::SSL

This commit is contained in:
Rafael Mendonça França 2012-03-19 16:26:52 -03:00
parent 09d884cd2c
commit 139bf55b26
2 changed files with 0 additions and 13 deletions

View file

@ -13,14 +13,11 @@ module ActionDispatch
@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 @@ module ActionDispatch
end
private
def exclude?(env)
@exclude && @exclude.call(env)
end
def redirect_to_https(request)
url = URI(request.url)
url.scheme = "https"

View file

@ -31,12 +31,6 @@ class SSLTest < ActionDispatch::IntegrationTest
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",