Rack::Utils.parse_query doesn't work for google refers (Rack 1.2.1)

9 views
Skip to first unread message

bobserr

unread,
Jul 28, 2010, 7:59:13 PM7/28/10
to Rack Development
Using Rack 1.2.1, Rails 2.3.8, 1.8.7

Hi, is anyone else having issues with Rack::Utils.parse_query under
Rack 1.2.1?

The following string does not parse properly. This is a HTTP_REFERER
string from Google:

http://www.google.com/search?q=4069431971&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

The following is returned:

{"oe"=>"utf-8", "http://www.google.com/search?q"=>"4069431971",
"rls"=>"org.mozilla:en-US:official", "aq"=>"t", "client"=>"firefox-a",
"ie"=>"utf-8"}

Note, the first parameter, "q", is parsed as "http://www.google.com/
search?q" rather than simply "q". This isn't correct.

Thanks,

Bob

Michael Fellinger

unread,
Jul 28, 2010, 8:54:04 PM7/28/10
to rack-...@googlegroups.com
On Thu, Jul 29, 2010 at 8:59 AM, bobserr <bob...@gmail.com> wrote:
> Using Rack 1.2.1, Rails 2.3.8, 1.8.7
>
> Hi, is anyone else having issues with Rack::Utils.parse_query under
> Rack 1.2.1?

Please note that parse_query does exactly that, it parses a query string.

>
> The following string does not parse properly. This is a HTTP_REFERER
> string from Google:
>
> http://www.google.com/search?q=4069431971&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
>
> The following is returned:
>
> {"oe"=>"utf-8", "http://www.google.com/search?q"=>"4069431971",
> "rls"=>"org.mozilla:en-US:official", "aq"=>"t", "client"=>"firefox-a",
> "ie"=>"utf-8"}
>
> Note, the first parameter, "q", is parsed as "http://www.google.com/
> search?q" rather than simply "q". This isn't correct.
>
> Thanks,
>
> Bob

--
Michael Fellinger
CTO, The Rubyists, LLC
I check email a couple times daily; to reach me sooner, use:
http://awayfind.com/manveru

Reply all
Reply to author
Forward
0 new messages