* e.g. No cross domain requests without CORS.
  *
  * @param {string|TypedAray} source Either a url to a PDF is located or a
- * typed array already populated with data.
+ * typed array (Uint8Array) already populated with data.
  * @return {Promise} A promise that is resolved with {PDFDocumentProxy} object.
  */
-PDFJS.getDocument = function getDocument(source) {
+PDFJS.getDocument = function getDocument(source, headers) {
   var promise = new PDFJS.Promise();
   var transport = new WorkerTransport(promise);
   if (typeof source === 'string') {
         error: function getPDFError(e) {
           promise.reject('Unexpected server response of ' +
             e.target.status + '.');
-        }
+        },
+       headers: headers
       },
       function getPDFLoad(data) {
         transport.sendData(data);