Sha256: a537945d300c28c1d7666742f0b7b0f8f4c76682c1c868b244bbd5f0f2a35761
Contents?: true
Size: 727 Bytes
Versions: 6
Compression:
Stored size: 727 Bytes
Contents
require 'action_controller/url_rewriter' module ActionController class UrlRewriter # Add a secure option to the rewrite method. def rewrite_with_secure_option(options = {}) secure = options.delete(:secure) if !secure.nil? && !SslRequirement.disable_ssl_check? if secure == true || secure == 1 || secure.to_s.downcase == "true" options.merge!({ :only_path => false, :protocol => 'https' }) else options.merge!({ :only_path => false, :protocol => 'http' }) end end rewrite_without_secure_option(options) end alias_method_chain :rewrite, :secure_option end end
Version data entries
6 entries across 6 versions & 3 rubygems