Error code: ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH

618 views Asked by At

I have a rails 2.3.8 application that worked just fine until I noticed that I'm not being able to download files from the same due to multiple Content-Length headers. Interesting stuff is when I run the app on development mode everything works fine but when I restart the app on production mode I get this set twice.

Here are two different response headers:

When on production:

HTTP/1.1 200 OK
Date: Thu, 25 Jul 2013 07:33:42 GMT
Server: Mongrel 1.1.5
Status: 200 OK
X-Sendfile: filename.pdf
Content-length: 386742
Content-Transfer-Encoding: binary
Cache-Control: no-cache
Content-Disposition: attachment; filename="6301 OCCUPANT EMERGENCY PROCEDURES.pdf"
Content-Type: application/pdf
Content-Length: 1
Set-Cookie: *******

And on dev mode

HTTP/1.1 200 OK
Date: Thu, 25 Jul 2013 07:58:05 GMT
Server: Mongrel 1.1.5
Status: 200 OK
Content-Transfer-Encoding: binary
Cache-Control: private
Content-Disposition: attachment; filename="6301 OCCUPANT EMERGENCY PROCEDURES.pdf"
Content-Type: application/pdf
Content-Length: 386742
Set-Cookie: bssonline=f7d1552a46e499430af3367a0144267e; path=/

So on the dev mode only one Content-Length is found once whereas in the prod mode it comes twice due which Im not able to download any files.

Any idea as to how to solve this issue ?

Thanks

0

There are 0 answers