Posted by cyx at September 24th, 2009

Have you ever run into the problem in Rails Metal where AJAX Requests just choke? When you try and debug the error response, it would stupidly reply “parseerror”.

After a long fought war with the browser that they call IE7, I discovered that this happens due to the Content-Type response header. I played around with different responses, and apparently returning the appropriate responses for my case (which were text/plain and application/json) resulted in IE choking.

THE SOLUTION: I switched to returning a content-type with application/octet-stream, and voila, everything worked as advertised. I hope this doesn’t happen to anyone else, although I’m pretty sure it will.