Fixed that query params could be forced to nil on a POST due to the raw post...

Fixed that query params could be forced to nil on a POST due to the raw post fix #562 [moriq@moriq.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@526 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 098fa943
*SVN*
* Fixed that query params could be forced to nil on a POST due to the raw post fix #562 [moriq@moriq.com]
* Fixed that cookies shouldn't be frozen in TestRequest #571 [Eric Hodel]
......
......@@ -14,7 +14,7 @@ def initialize_query()
@params = CGI::parse(read_query_params)
end
@cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
@cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] || env_table['COOKIE']))
end
private
......@@ -30,13 +30,13 @@ def read_query_params
case env_table['REQUEST_METHOD']
when 'GET', 'HEAD'
if defined? MOD_RUBY
Apache::request.args or ''
Apache::request.args || ''
else
env_table['QUERY_STRING'] or ''
env_table['QUERY_STRING'] || ''
end
when 'POST'
stdinput.binmode if stdinput.respond_to?(:binmode)
content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or ''
content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || ''
env_table['RAW_POST_DATA'] = content.freeze
else
read_from_cmdline
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册