title: Content-Disposition is always null
body: <p>I've a got a function in my web api 2.0 to download a file but hadn't tried it in a while and only discovered yesterday that it was no longer working. I've partially fixed the issue with <code>createObjectURL</code> but one thing I've noticed is that while the <code>Content-Disposition</code> is set in my web api:</p>
  <pre><code>public Task&lt;HttpResponseMessage&gt; ExecuteAsync(CancellationToken cancellationToken)
  {
      var response = new HttpResponseMessage();
      var filename = this.Document.GetFilename();
      var mimeType = MimeMapping.GetMimeMapping(filename);
      
      response.Content = new StreamContent(new MemoryStream(this.Document.ToData()));     
      response.Content.Headers.ContentLength = this.Document.Data.Length;     
      response.Content.Headers.ContentType = new MediaTypeHeaderValue(mimeType);
  
      response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue(&quot;attachment&quot;)
      {
          FileName = filename
      };
  
      return Task.FromResult(response);
  }
  </code></pre>
  <p>Yet when I check it in <code>JavaScript</code>, it always null from the response header:</p>
  <pre><code>success: function (blob, status, xhr) {
     var filename = &quot;&quot;;
     var disposition = xhr.getResponseHeader('Content-Disposition');
     ...
  }
  </code></pre>
  <p>Any ideas why?</p>
  <p>Thanks.</p>
  <p><strong>UPDATE-1:</strong></p>
  <p>The content disposition appears to be returned when I check the response in the <code>Network</code> section of the browser but when I call <code>xhr.getAllResponseHeaders()</code> or <code>xhr.getResponseHeader('Content-Disposition');</code>, it is not returned by either function calls as you can see in the snapshot below:</p>
  <p><a href="https://i.stack.imgur.com/2eF29.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2eF29.png" alt="enter image description here" /></a></p>