[Mongrel] Can't serve files with query string to IE

Graham Ashton graham.ashton at gmail.com
Thu Jul 5 04:20:59 EDT 2007

I've been seeing some weird behaviour with IE. I'm running mongrel
1.0.1 with Rails, in a development environment (so Apache/Pound aren't
involved yet).

IE (versions 6 and 7) are unable to retrieve any static files (e.g.
stylesheets or images) from mongrel if the URL contains a question
mark and a query string. It's okay with static files that don't have a
query string appended.

Rather than serve the file, once the query string is appended, mongrel
passes the request through to Rails, and I get a routing error.

This is unfortunate, as Rails likes to append a question mark to all
the CSS and JavaScript URLs, which makes it impossible for IE to
retrieve them.

I did some packet sniffing, and have narrowed down what it is that
causes IE to stumble. It sends a GET request that looks like this:

  GET http://hostname:3000/path/to/file?foo HTTP/1.1

rather than this:

  GET /path/to/file?foo HTTP/1.1

I've reproduced the behaviour with telnet.

Has anybody else seen this behaviour?

I should mention that it's only the copies of IE that run inside my
VMs that produce these weird GET requests; another copy of IE in the
office works fine, and doesn't prepend http://hostname:3000 to each

Browsing the web with this copy of IE appears to be fine.

I'm flummoxed by this, and wonder whether anybody might be able to
suggest what's causing IE to freak out in my VM. I'm hoping that if I
were to run mongrel behind Pound that the issue would just go away,
but I'd rather know the cause than just cross my fingers...



More information about the Mongrel-users mailing list