aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2005-11-21 08:04:28 +0000
committerSam Stephenson <sam@37signals.com>2005-11-21 08:04:28 +0000
commitede2a222ee9412f1f6e671470edc3c18449bbe45 (patch)
tree04d6c79623a0904200d28e13ed5d971ad1e2b393
parent7355d9f1bd9af02da0fb28eefeecf4fbee2aaf5b (diff)
downloadrails-ede2a222ee9412f1f6e671470edc3c18449bbe45.tar.gz
rails-ede2a222ee9412f1f6e671470edc3c18449bbe45.tar.bz2
rails-ede2a222ee9412f1f6e671470edc3c18449bbe45.zip
Strip out trailing &_= for raw post bodies #2868
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 3faf510337..2674fe0680 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Strip out trailing &_= for raw post bodies. Closes #2868. [Sam Stephenson]
+
* Pass multiple arguments to Element.show and Element.hide in JavaScriptGenerator instead of using iterators. [Sam Stephenson]
* Improve expire_fragment documentation. #2966 [court3nay@gmail.com]
diff --git a/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb b/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
index bb8bf9c2de..3057dba1b5 100644
--- a/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
+++ b/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
@@ -54,6 +54,7 @@ class CGI #:nodoc:
content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || ''
# fix for Safari Ajax postings that always append \000
content.chop! if content[-1] == 0
+ content.gsub! /&_=$/, ''
env_table['RAW_POST_DATA'] = content.freeze
end