It just takes 15 seconds. Send your
details and we’ll get back to you soon.

Duplicate headers received from server issue on chrome

Hi,
 
Recently, in my project while downloading some files(not on all files) i am getting exception on chrome, that say :
 
Duplicate headers received from server

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

But when i download the same files on IE, Firefox and other browsers that causing exception, no problem occur it work like charm. :)
 
But its weird that why is chrome giving exception only on some files while downloading, then i searched, i found that new release of chrome has this problem. It seem like Content-disposition header become very strict and sensitive, in the spec that chrome uses.
 
Solution that worked for me to solve the problem :
 
Wrong :

response.setHeader(“Content-disposition”, “attachment; filename=${fileName}”)

Correct :

response.setHeader(“Content-disposition”, “attachment; filename=\””+fileName+”\””)
 
It worked for me. Hope it helps you also :)
 
Thanks,
Tarun Pareek
tarun@intelligrape.com
http://in.linkedin.com/in/tarunpareek
More Blogs by Me

Thanks & Regards, Tarun Pareek tarun@intelligrape.com http://in.linkedin.com/in/tarunpareek More Blogs by Me

One Response to Duplicate headers received from server issue on chrome

  1. Pradnya says:

    i am trying to export xml with name “,”.that time its giving same error

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 70 = 73

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>