Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

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  
    4343   
    4444  def test_authentication_request 
    4545    authentication_request(@controller, "Megaglobalapp") 
     46    assert_equal 'UTF-8', @controller.headers["Accept-Charset"] 
    4647    assert_equal 'Basic realm="Megaglobalapp"', @controller.headers["WWW-Authenticate"] 
    4748    assert_equal :unauthorized, @controller.renders.first[:status] 
    4849  end 
  • actionpack/lib/action_controller/http_authentication.rb

    old new  
    120120      end 
    121121 
    122122      def authentication_request(controller, realm) 
     123        controller.headers["Accept-Charset"] = 'UTF-8' 
    123124        controller.headers["WWW-Authenticate"] = %(Basic realm="#{realm.gsub(/"/, "")}") 
    124125        controller.send! :render, :text => "HTTP Basic: Access denied.\n", :status => :unauthorized 
    125126        return false