aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/rack_ext/parse_query.rb
diff options
context:
space:
mode:
authorAhmed El-Daly <aeldaly@developergurus.com>2009-01-21 22:18:10 -0500
committerAhmed El-Daly <aeldaly@developergurus.com>2009-01-21 22:18:10 -0500
commitf08a78a057782577d5efbc82662d7898e26dcb8c (patch)
treed0638cf1d180ed3713ecafcf36ea1df9bc5eeb7a /actionpack/lib/action_controller/rack_ext/parse_query.rb
parentc5069bd4951419ea02aea35ac5c121bc0c311940 (diff)
parente8f7da6118936af2d145b3c025db4b4dcd0b3308 (diff)
downloadrails-f08a78a057782577d5efbc82662d7898e26dcb8c.tar.gz
rails-f08a78a057782577d5efbc82662d7898e26dcb8c.tar.bz2
rails-f08a78a057782577d5efbc82662d7898e26dcb8c.zip
Merge branch 'master' of git@github.com:lifo/docrails
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