diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-01-17 20:29:50 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-17 20:29:50 -0600 |
commit | ff0a2678c4bce9da348e1263915558795e3a3640 (patch) | |
tree | 3c5b6ab01afaa3d01198d8755e1dc38fa18f5af4 /actionpack/lib/action_controller/rack_ext/parse_query.rb | |
parent | aab760c3df4c02377a59a418fc077cdbc07e9fdc (diff) | |
download | rails-ff0a2678c4bce9da348e1263915558795e3a3640.tar.gz rails-ff0a2678c4bce9da348e1263915558795e3a3640.tar.bz2 rails-ff0a2678c4bce9da348e1263915558795e3a3640.zip |
Build query string and POST params parser on top of Rack::Request. Also switch our multipart parser to use Racks. Moved XML, JSON, and YAML parsers into ActionController::ParamsParser middleware [#1661 state:resolved]
Diffstat (limited to 'actionpack/lib/action_controller/rack_ext/parse_query.rb')
-rw-r--r-- | actionpack/lib/action_controller/rack_ext/parse_query.rb | 18 |
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 |