Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove exclude option from ActionDispatch::SSL

  • Loading branch information...
commit 139bf55b26e3a415c11fcf631c2dead81bd9df67 1 parent 09d884c
@rafaelfranca rafaelfranca authored
View
7 actionpack/lib/action_dispatch/middleware/ssl.rb
@@ -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"
View
6 actionpack/test/dispatch/ssl_test.rb
@@ -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",
Please sign in to comment.
Something went wrong with that request. Please try again.