diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 14:15:26 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-18 14:15:26 +0000 |
commit | e9681eb9c5bd29f555d56bb9842f1d561334a21e (patch) | |
tree | 8d1900e0a8e0e0c9491d540e7f255ead8b2addd6 /actionpack/lib | |
parent | a37b8b33d4d5da6a671205551bf4473cea2a4692 (diff) | |
download | rails-e9681eb9c5bd29f555d56bb9842f1d561334a21e.tar.gz rails-e9681eb9c5bd29f555d56bb9842f1d561334a21e.tar.bz2 rails-e9681eb9c5bd29f555d56bb9842f1d561334a21e.zip |
Added graceful handling of PUT, DELETE, and OPTIONS requests for a complete coverage of REST functionality #1136 [joshknowles@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb | 10 |
1 files changed, 3 insertions, 7 deletions
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 7b3465c4a8..d6dbbd737f 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 @@ -28,13 +28,9 @@ class CGI #:nodoc: def read_query_params case env_table['REQUEST_METHOD'] - when 'GET', 'HEAD' - if defined? MOD_RUBY - Apache::request.args || '' - else - env_table['QUERY_STRING'] || '' - end - when 'POST' + when 'GET', 'HEAD', 'DELETE', 'OPTIONS' + (defined?(MOD_RUBY) ? Apache::request.args : env_table['QUERY_STRING']) || '' + when 'POST', 'PUT' stdinput.binmode if stdinput.respond_to?(:binmode) content = stdinput.read(Integer(env_table['CONTENT_LENGTH'])) || '' env_table['RAW_POST_DATA'] = content.split("&_").first.to_s.freeze # &_ is a fix for Safari Ajax postings that always append \000 |