title: Chrome, pdf display, Duplicate headers received from the server
body: <p>I have a section on a website where I display a pdf inside a light box. The recent chrome upgrade has broken this displaying:</p>
  
  <blockquote>
    <p>Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION):
    Multiple Content-Disposition headers received. This is disallowed to
    protect against HTTP response-splitting attacks.</p>
  </blockquote>
  
  <p>This still works correctly in IE.</p>
  
  <p>I'm using ASP.NET MVC3 on IIS6</p>
  
  <p>The code I use to generate the file is as follows. </p>
  
  <p>If I remove the inline statement then the file downloads, however that breaks the lightbox functionality.</p>
  
  <p><strong>Problem Code</strong></p>
  
  <pre><code>public FileResult PrintServices()
  {
      //... unrelated code removed
      MemoryStream memoryStream = new MemoryStream();
      pdfRenderer.PdfDocument.Save(memoryStream);
      string filename = "ServicesSummary.pdf";
  
      Response.AppendHeader("Content-Disposition", "inline;");
  
      return File(memoryStream.ToArray(), "application/pdf", filename);
  }
  </code></pre>
  
  <hr>
  
  <p><strong>The Fix</strong></p>
  
  <p>Remove</p>
  
  <pre><code>Response.AppendHeader("Content-Disposition", "inline;");
  </code></pre>
  
  <p>Then Change </p>
  
  <pre><code>return File(memoryStream.ToArray(), "application/pdf", filename);
  </code></pre>
  
  <p>to</p>
  
  <pre><code>return File(memoryStream.ToArray(), "application/pdf");
  </code></pre>