Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/url_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Routing
class RouteSet

# Add a secure option to the rewrite method.
def url_for_with_secure_option(options = {})
def url_for_with_secure_option(options = {}, *args)
secure = options.delete(:secure)

# if secure && ssl check is not disabled, convert to full url with https
Expand All @@ -30,18 +30,18 @@ def url_for_with_secure_option(options = {})
end
end

url_for_without_secure_option(options)
url_for_without_secure_option(options, *args)
end

# if full URL is requested for http and we've been told to use a
# non-ssl host override, then use it
def url_for_with_non_ssl_host(options)
def url_for_with_non_ssl_host(options, *args)
if !options[:only_path] && !SslRequirement.non_ssl_host.nil?
if !(/^https/ =~ (options[:protocol] || @request.try(:protocol)))
options.merge! :host => SslRequirement.non_ssl_host
end
end
url_for_without_non_ssl_host(options)
url_for_without_non_ssl_host(options, *args)
end

# want with_secure_option to get run first (so chain it last)
Expand Down