PDF.js CORS issue
<p>I'm having an issue with PDF.js and CORS configuration.</p>

<p>From domain A I'm loading PDF.js into an iframe with a file as parameter (full path to the server, which will return a pdf document). PDF.js will create a request to the server at domain B with <code>origin: domain A</code>. The server at domain B returns the pdf document with header <code>Access-Control-Allow-Origin: domain A</code>, so far so good. </p>

<p>In my network tab I see the request to the server, which is returning a 200 status OK, but PDF.js is throwing an error <code>Unexpected server response (0) while retrieving PDF &lt;url&gt;</code>.</p>

<p>The question is, what's going on here, CORS seems to be ok, but I can't really get any more info from PDF.js what the real reason is the PDF is failing to load. Is there anyone who encountered the same?</p>