Google Chrome Duplicate Headers Fix

by Matt | Haulix 10. January 2012 21:47

Duplicate headers received from server. 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 350 (net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION): Multiple Location headers received. This is disallowed to protect against HTTP response splitting attacks.

Chrome did a security update recently that makes their browser adhere to web standards more "strictly." It in turn broke quite a few websites/applications out there.  If you get this error in your C# application, here is a fix:

When calling the Response's AddHeader method, make sure attachment has a semi-colon after it (instead of a comma) and put quotes around the filename.

context.Response.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}.zip\"", title));

Tags:

Add comment




biuquote
  • Comment
  • Preview
Loading


© 2011 Haulix, LLC. All rights reserved. About Us | Sign In | Contact Us