aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorArthur Nogueira Neves <github@arthurnn.com>2015-04-14 17:00:32 -0400
committerArthur Nogueira Neves <github@arthurnn.com>2015-04-14 17:00:32 -0400
commit7d4a1ab9eef66879b52fbc1779a6056b3e880589 (patch)
tree80e30946e84383ea56093ac7fee5196221c00fe9 /actionpack/lib
parentfcd8e6270833b2e8a8e1417ad67f774a08579d54 (diff)
parent53dedfcde9e9ba9552831736def05b3dcacbaeb3 (diff)
downloadrails-7d4a1ab9eef66879b52fbc1779a6056b3e880589.tar.gz
rails-7d4a1ab9eef66879b52fbc1779a6056b3e880589.tar.bz2
rails-7d4a1ab9eef66879b52fbc1779a6056b3e880589.zip
Merge pull request #19757 from Strech/http-auth-realm-unquoting
Tiny optimization of http auth Realm unquoting
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/http_authentication.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb
index c492b7fb64..909ed19a49 100644
--- a/actionpack/lib/action_controller/metal/http_authentication.rb
+++ b/actionpack/lib/action_controller/metal/http_authentication.rb
@@ -118,7 +118,7 @@ module ActionController
end
def authentication_request(controller, realm)
- controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.gsub('"'.freeze, "".freeze)}")
+ controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.tr('"'.freeze, "".freeze)}")
controller.status = 401
controller.response_body = "HTTP Basic: Access denied.\n"
end
@@ -499,7 +499,7 @@ module ActionController
#
# Returns nothing.
def authentication_request(controller, realm)
- controller.headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub('"'.freeze, "".freeze)}")
+ controller.headers["WWW-Authenticate"] = %(Token realm="#{realm.tr('"'.freeze, "".freeze)}")
controller.__send__ :render, :text => "HTTP Token: Access denied.\n", :status => :unauthorized
end
end