Parsing params (one of the params value has ampersand)


I am trying to parse a URL of this format

I need to get 2 params

deal_id and url

However, in the above example, if I do params[:url], then I get

product_id=275 is dropped on the floor as its considered another

CGI:escape for url is not an option since I have no choice in what I am
being passed...

Any ideas?

1) Parse the entire query string yourself instead of using the params

2) Explicitly retrieve params['product_id'] and (re)build the url param
    as you need it in the controller.

3) Fix the request (as in #2) in a Rack middleware filter.

4) Tell the "no-choice" source of these malformed unescaped URLs
     to read the damn RFCs :slight_smile: