Failing to parse query parameters when using a custom host name #3

HoneyryderChuck opened this Issue Mar 22, 2012 · 0 comments


None yet
1 participant


I have recently discovered something that quite amazed me: Try setting a new Rails 3 application, create a custom name for your localhost (let's say, ""), install mongrel as gem, and then create an action that does this:

render :text => params[:page] || "unspecified"

then just do:

basically, i'm not getting the page parameter output, query parameters are always being parsed out all the time, so that means doing that is the same as doing . If I use localhost as host, it works fine.

I've currently "hacked" the mongrel.rb file in order for it to work. So, at the line 128 of mongrel.db:

params[Const::REQUEST_PATH] = uri.path
params['QUERY_STRING'] = uri.query # hack

this is just a temporary hack that works the problem around, I guess. Basically, the HttpParser (http11.c) is parsing it wrong when the host is a custom one.

What do you think? Do you get the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment