title: Error: Resource interpreted as Document but transferred with MIME type application/pdf
body: <p>I am sending a PDF stream from my server to the client and then displaying that PDF in an <code>&lt;object&gt;</code> tag in the client. Here is my code:</p>
  
  <p><strong>server.js</strong></p>
  
  <pre><code>router.get('/pdf', function * () {
    var stream = getMyFileStream();
    this.set('Content-Type', 'application/pdf');
    this.response.body = stream;
  });
  </code></pre>
  
  <p><strong>client.js</strong></p>
  
  <pre><code>var objectElement = document.querySelector('object');
  
  fetch('/pdf', request)
    .then(res =&gt; res.blob())
    .then(blob =&gt; URL.createObjectURL(blob))
    .then(url =&gt; {
      objectElement.setAttribute('data', url)
      objectElement.setAttribute('type', 'application/pdf')
    })
  </code></pre>
  
  <p>This code seems to work correctly, however I get the following warning in my console:</p>
  
  <blockquote>
    <p>Resource interpreted as Document but transferred with MIME type application/pdf</p>
  </blockquote>
  
  <p>Why does it think my resource should be <code>text/html</code>? If I change my <code>Content-Type</code> header to <code>text/html</code>, it makes the warning go away but it obviously causes a rendering issue of the PDF. Any help would be appreciated.</p>