Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Duplicate headers received from server (http://www.go4expert.com/forums/duplicate-headers-received-server-t29506/)

shabbir 21Feb2013 19:57

Duplicate headers received from server
Viewing an image through PHP code in Chrome says Duplicate headers received from server but works fine in FF and even in IE9

The detail of the error is :


The response from the server contained duplicate headers. This problem is generally the result of a misconfigured website or proxy. Only the website or proxy administrator can fix this issue.

Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOS ITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.

shabbir 21Feb2013 20:02

Re: Duplicate headers received from server
For those who encounter the same issue here is what is causing the issue and what could be the possible solution.

The issue is normally when you have a PHP page that displays an image you have the header as


Content-Disposition: Inline; filename=someimagefilename.imageextensions
Now if you have a filename containing a comma then above headers becomes


Content-Disposition: Inline; filename=someimagefilename,somecharacters.imageextensions
And this causes chrome to throw an error of double headers - ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOS ITION

To fix the issue just delete the current file and upload a new file that does not have the comma in the file name or make your code such that if they have comma they are replaced.

Hope it helps.

All times are GMT +5.5. The time now is 12:31.