title: How to add custom headers in getDocument() request of pdfjs
body: <p>Trying to add custom headers to the pdfjs getDocument request.</p>
  
  <p>Based on the <a href="https://github.com/mozilla/pdf.js/issues/3852" rel="nofollow noreferrer">GitHub</a> suggestion have tried to add it.</p>
  
  <p>Even while Debugging it is being shown but I am not sure why it is not working.</p>
  
  <p>Below is my js code</p>
  
  <pre><code>var parameter = {
    url: this.url,
    httpHeaders: { Authorization: `password` },
    withCredentials: true,
  } 
  var loadingTask = pdfjsLib.getDocument(parameters);
  </code></pre>
  
  <p>This is my chrome network request</p>
  
  <p><a href="https://i.stack.imgur.com/1EAt9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1EAt9.png" alt="enter image description here"></a></p>