Skip to content
This repository
Browse code

r4748@asus: jeremy | 2006-06-29 22:40:35 -0700

 Loosen urlencoded content type check.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit d0526ede40c1ebe4b1bcd9d5efbc04254f4c8cbf 1 parent 5446ecd
Jeremy Kemper authored June 30, 2006
2  actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
@@ -36,7 +36,7 @@ def initialize_query
36 36
         if boundary = extract_multipart_form_boundary(content_type)
37 37
           @multipart = true
38 38
           @params = read_multipart(boundary, content_length)
39  
-        elsif content_type.blank? || content_type.downcase !~ %r{^application/x-www-form-urlencoded.*}
  39
+        elsif content_type.blank? || content_type !~ %r{application/x-www-form-urlencoded}i
40 40
           read_params(method, content_length)
41 41
           @params = {}
42 42
         end
2  actionpack/test/controller/raw_post_test.rb
@@ -11,7 +11,7 @@ def setup
11 11
 
12 12
   def test_post_with_urlencoded_body
13 13
     ENV['REQUEST_METHOD'] = 'POST'
14  
-    ENV['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
  14
+    ENV['CONTENT_TYPE'] = ' apPlication/x-Www-form-urlEncoded; charset=utf-8'
15 15
     assert_equal ['1'], cgi_params['a']
16 16
     assert_has_raw_post_data
17 17
   end

0 notes on commit d0526ed

Please sign in to comment.
Something went wrong with that request. Please try again.