aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-19 06:42:29 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-19 06:42:29 +0000
commit8ea1fadcbeefeb1b7f4bc46c083b0c761cde41e3 (patch)
tree40b4e85281247707cfdcf6a040a7cfcf4636ec2b /actionpack
parent5f4f4b03f2b5d4dd93388dd144166cd59593b0a9 (diff)
downloadrails-8ea1fadcbeefeb1b7f4bc46c083b0c761cde41e3.tar.gz
rails-8ea1fadcbeefeb1b7f4bc46c083b0c761cde41e3.tar.bz2
rails-8ea1fadcbeefeb1b7f4bc46c083b0c761cde41e3.zip
If RAW_POST_DATA was set explicitly, use that (closes #4281)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/test_process.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index 5e6f421946..267263c364 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -43,13 +43,17 @@ module ActionController #:nodoc:
end
def raw_post
- params = self.request_parameters.dup
- %w(controller action only_path).each do |k|
- params.delete(k)
- params.delete(k.to_sym)
- end
+ if raw_post = env['RAW_POST_DATA']
+ raw_post
+ else
+ params = self.request_parameters.dup
+ %w(controller action only_path).each do |k|
+ params.delete(k)
+ params.delete(k.to_sym)
+ end
- params.map { |k,v| [ CGI.escape(k.to_s), CGI.escape(v.to_s) ].join('=') }.sort.join('&')
+ params.map { |k,v| [ CGI.escape(k.to_s), CGI.escape(v.to_s) ].join('=') }.sort.join('&')
+ end
end
def port=(number)