Skip to content

Commit

Permalink
using rack utils to build querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbuddy committed May 5, 2009
1 parent 544b867 commit b7fd99e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rack_rewrite/actions.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'rack' require 'rack'
require 'cgi'


module Rack module Rack
class Rewrite class Rewrite
Expand All @@ -17,7 +16,7 @@ def query_string=(params)
env = @request.env env = @request.env
env['QUERY_STRING'] = case params env['QUERY_STRING'] = case params
when Hash when Hash
params.inject([]) { |qs, (k, v)| qs << "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}"} * '&' Rack::Utils.build_query(params)
else else
params params
end end
Expand Down

0 comments on commit b7fd99e

Please sign in to comment.