Duplicate headers received from server

shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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 :

Quote:
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's Avatar, Join Date: Jul 2004
Go4Expert Founder
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

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

Code:
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.
ManzZup like this