提交 d0526ede 编写于 作者: J Jeremy Kemper

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
上级 5446ecd5
......@@ -36,7 +36,7 @@ def initialize_query
if boundary = extract_multipart_form_boundary(content_type)
@multipart = true
@params = read_multipart(boundary, content_length)
elsif content_type.blank? || content_type.downcase !~ %r{^application/x-www-form-urlencoded.*}
elsif content_type.blank? || content_type !~ %r{application/x-www-form-urlencoded}i
read_params(method, content_length)
@params = {}
end
......
......@@ -11,7 +11,7 @@ def setup
def test_post_with_urlencoded_body
ENV['REQUEST_METHOD'] = 'POST'
ENV['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
ENV['CONTENT_TYPE'] = ' apPlication/x-Www-form-urlEncoded; charset=utf-8'
assert_equal ['1'], cgi_params['a']
assert_has_raw_post_data
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册