Rails app- Firefox prompts me to save octet-stream

Hi -

I host a rails app on dreamhost. When you log in or log out, a dialog box pops up telling me I’m downloading an octet-stream and prompts me to save it. It also happens on a variety of other pages. This happens with Firefox (and may appear on other versions, I don’t know). I’ve confirmed it on 2 machines.

I am sure the app works, I have no such problem when I run it on my local machine (from the development rails environment) and like I said, it works just fine on ie.

For fun, I decided to save the octet stream and rename it with an html extension, and this is what it is:

� w»îe���HTTP/1.1 302 Found Date: Tue, 22 Jul 2008 02:31:41 GMT Server: Apache/2.2.9 (Unix) PHP/4.4.7 mod_ssl/2.2.9 OpenSSL/0.9.8c mod_fastcgi/2.4.6 Phusion_Passenger/1.9.1 DAV/2 SVN/1.4.2 Set-Cookie: _thrive_session=56e78897ebc21d7611c83e52bf1f972c; path=/ X-Runtime: 0.00881 Cache-Control: no-cache Content-Length: 116 Location: http://www.thriveorfail.com/stories/leader_stories Vary: Accept-Encoding Content-Encoding: gzip Keep-Alive: timeout=2, max=99 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 ‹������,Í1Â0ЫD=@¼#“{0UnóK,¥5r ·Gªßô¸ÅÞ/V¿åaï$Ž´@gbIͱݧñº1r4×Ì7ÑžWÛésÅIRáóŸSqTu¬Ê$%3]Óµý���ÿÿ�W˜mt���

So, anyone have any ideas what this is? For what it’s worth, I do successfully log in, so I can then click my way over to other pages, so I don’t know what’s going on. Anyone ever seen this before? Is it a rails configuration error on my part that only manifests itself on firefox?

Thanks for any help,

I think your script is garbling the HTTP headers in its outbound transmissions; the data you saved included a “text/html” MIME header, like an HTML document should have, but the header shouldn’t appear in the saved data unless the header was transmitted incorrectly. There also seem to be a lot of weird control characters, like random binary data got into your data stream.

The stuff working in M$IE isn’t necessarily surprising, since that browser does a lot of second-guessing of data and MIME type headers in violation of standards, which sometimes hides errors from the user.

– Dan