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

Ticket #8407: ajax-request-param-parsing.diff

File ajax-request-param-parsing.diff, 1.2 kB (added by jsierles, 2 years ago)
  • lib/action_controller/cgi_process.rb

    old new  
    7272    end 
    7373 
    7474    def request_parameters 
    75       @request_parameters ||= self.class.parse_formatted_request_parameters(body, content_type_with_parameters, content_length, env) 
     75      @request_parameters ||= self.class.parse_formatted_request_parameters(body, content_type, content_length, env) 
    7676    end 
    7777 
    7878    def cookies 
  • test/controller/cgi_test.rb

    old new  
    1010    @request = ActionController::CgiRequest.new(@fake_cgi) 
    1111  end 
    1212 
     13  def test_request_parameter_parse_with_charset 
     14    data = 'flamenco=love' 
     15    @request.env['CONTENT_LENGTH'] = data.length 
     16    @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8' 
     17    @request.env['RAW_POST_DATA'] = data 
     18    assert_equal({"flamenco"=> "love"}, @request.request_parameters) 
     19  end 
     20 
    1321  def test_proxy_request 
    1422    assert_equal 'glu.ttono.us', @request.host_with_port 
    1523  end