Ticket #9747: send_accept_charset_header_with_basic_auth.diff
| File send_accept_charset_header_with_basic_auth.diff, 1.2 kB (added by norbert, 1 year ago) |
|---|
-
actionpack/test/controller/http_authentication_test.rb
old new 43 43 44 44 def test_authentication_request 45 45 authentication_request(@controller, "Megaglobalapp") 46 assert_equal 'UTF-8', @controller.headers["Accept-Charset"] 46 47 assert_equal 'Basic realm="Megaglobalapp"', @controller.headers["WWW-Authenticate"] 47 48 assert_equal :unauthorized, @controller.renders.first[:status] 48 49 end -
actionpack/lib/action_controller/http_authentication.rb
old new 120 120 end 121 121 122 122 def authentication_request(controller, realm) 123 controller.headers["Accept-Charset"] = 'UTF-8' 123 124 controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.gsub(/"/, "")}") 124 125 controller.send! :render, :text => "HTTP Basic: Access denied.\n", :status => :unauthorized 125 126 return false