class Rack::QueryParser
def parse_query(qs, separator = nil, &unescaper)
to parse cookies by changing the characters used in the second parameter
Parses a query string by breaking it up at the '&'. You can also use this
Stolen from Mongrel, with some small modifications:
def parse_query(qs, separator = nil, &unescaper) unescaper ||= method(:unescape) params = make_params (qs || '').split(separator ? (COMMON_SEP[separator] || /[#{separator}] */n) : DEFAULT_SEP).each do |p| next if p.empty? k, v = p.split('=', 2).map!(&unescaper) if cur = params[k] if cur.class == Array params[k] << v else params[k] = [cur, v] end else params[k] = v end end return params.to_h end