Skip to content
This repository
Browse code

Fixed that query params could be forced to nil on a POST due to the r…

…aw post fix #562 [moriq@moriq.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@526 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit b8e4c78abba471ec3bcce29237644df24925d1a7 1 parent 098fa94
David Heinemeier Hansson dhh authored
2  actionpack/CHANGELOG
... ... @@ -1,5 +1,7 @@
1 1 *SVN*
2 2
  3 +* Fixed that query params could be forced to nil on a POST due to the raw post fix #562 [moriq@moriq.com]
  4 +
3 5 * Fixed that cookies shouldn't be frozen in TestRequest #571 [Eric Hodel]
4 6
5 7
8 actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
@@ -14,7 +14,7 @@ def initialize_query()
14 14 @params = CGI::parse(read_query_params)
15 15 end
16 16
17   - @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
  17 + @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] || env_table['COOKIE']))
18 18 end
19 19
20 20 private
@@ -30,13 +30,13 @@ def read_query_params
30 30 case env_table['REQUEST_METHOD']
31 31 when 'GET', 'HEAD'
32 32 if defined? MOD_RUBY
33   - Apache::request.args or ''
  33 + Apache::request.args || ''
34 34 else
35   - env_table['QUERY_STRING'] or ''
  35 + env_table['QUERY_STRING'] || ''
36 36 end
37 37 when 'POST'
38 38 stdinput.binmode if stdinput.respond_to?(:binmode)
39   - content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) or ''
  39 + content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || ''
40 40 env_table['RAW_POST_DATA'] = content.freeze
41 41 else
42 42 read_from_cmdline

0 comments on commit b8e4c78

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