aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rack_ext/parse_query.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-01-18 17:45:39 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-01-18 17:45:39 +0000
commitaeafccf0ca2b7596a0b08c275d2c2154992fe573 (patch)
treec0ab58cbfe0defc8e1078044e83d687d465d4d14 /actionpack/lib/action_controller/rack_ext/parse_query.rb
parente35e5ed2a4c87a10c70aa6b87a411182ce967c21 (diff)
parent085991891e610ed0ab616ce434eabf42a9437039 (diff)
downloadrails-aeafccf0ca2b7596a0b08c275d2c2154992fe573.tar.gz
rails-aeafccf0ca2b7596a0b08c275d2c2154992fe573.tar.bz2
rails-aeafccf0ca2b7596a0b08c275d2c2154992fe573.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_controller/rack_ext/parse_query.rb')
-rw-r--r--actionpack/lib/action_controller/rack_ext/parse_query.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/rack_ext/parse_query.rb b/actionpack/lib/action_controller/rack_ext/parse_query.rb
new file mode 100644
index 0000000000..2f21a57770
--- /dev/null
+++ b/actionpack/lib/action_controller/rack_ext/parse_query.rb
@@ -0,0 +1,18 @@
+# Rack does not automatically cleanup Safari 2 AJAX POST body
+# This has not yet been commited to Rack, please +1 this ticket:
+# http://rack.lighthouseapp.com/projects/22435/tickets/19
+
+module Rack
+ module Utils
+ alias_method :parse_query_without_ajax_body_cleanup, :parse_query
+ module_function :parse_query_without_ajax_body_cleanup
+
+ def parse_query(qs, d = '&;')
+ qs = qs.dup
+ qs.chop! if qs[-1] == 0
+ qs.gsub!(/&_=$/, '')
+ parse_query_without_ajax_body_cleanup(qs, d)
+ end
+ module_function :parse_query
+ end
+end