Browse Source

PDF.js version 1.9.506 - See mozilla/pdf.js@47789b51c3b02b298f765e534b17e25ee786bd1f

pdfjsbot 7 years ago
parent
commit
bfd8cd5028

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.9.504",
+  "version": "1.9.506",
   "main": [
     "build/pdf.js",
     "build/pdf.worker.js"

+ 6 - 6
build/pdf.combined.js

@@ -13458,8 +13458,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.504';
-  exports.build = build = '0430e99d';
+  exports.version = version = '1.9.506';
+  exports.build = build = '47789b51';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -29216,8 +29216,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.504';
-var pdfjsBuild = '0430e99d';
+var pdfjsVersion = '1.9.506';
+var pdfjsBuild = '47789b51';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(98);
 var pdfjsDisplayAPI = __w_pdfjs_require__(55);
@@ -35079,8 +35079,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.504';
-  PDFJS.build = '0430e99d';
+  PDFJS.version = '1.9.506';
+  PDFJS.build = '47789b51';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

File diff suppressed because it is too large
+ 0 - 0
build/pdf.combined.js.map


+ 6 - 6
build/pdf.js

@@ -4185,8 +4185,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.504';
-  exports.build = build = '0430e99d';
+  exports.version = version = '1.9.506';
+  exports.build = build = '47789b51';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -7064,8 +7064,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.504';
-var pdfjsBuild = '0430e99d';
+var pdfjsVersion = '1.9.506';
+var pdfjsBuild = '47789b51';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(82);
 var pdfjsDisplayAPI = __w_pdfjs_require__(48);
@@ -12927,8 +12927,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.504';
-  PDFJS.build = '0430e99d';
+  PDFJS.version = '1.9.506';
+  PDFJS.build = '47789b51';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

File diff suppressed because it is too large
+ 0 - 0
build/pdf.js.map


File diff suppressed because it is too large
+ 0 - 0
build/pdf.min.js


+ 2 - 2
build/pdf.worker.js

@@ -24517,8 +24517,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph;
 "use strict";
 
 
-var pdfjsVersion = '1.9.504';
-var pdfjsBuild = '0430e99d';
+var pdfjsVersion = '1.9.506';
+var pdfjsBuild = '47789b51';
 var pdfjsCoreWorker = __w_pdfjs_require__(62);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 

File diff suppressed because it is too large
+ 0 - 0
build/pdf.worker.js.map


+ 2 - 2
lib/display/api.js

@@ -1581,8 +1581,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.504';
-  exports.build = build = '0430e99d';
+  exports.version = version = '1.9.506';
+  exports.build = build = '47789b51';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;

+ 2 - 2
lib/display/global.js

@@ -45,8 +45,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.504';
-  PDFJS.build = '0430e99d';
+  PDFJS.version = '1.9.506';
+  PDFJS.build = '47789b51';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

+ 2 - 2
lib/pdf.js

@@ -14,8 +14,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.504';
-var pdfjsBuild = '0430e99d';
+var pdfjsVersion = '1.9.506';
+var pdfjsBuild = '47789b51';
 var pdfjsSharedUtil = require('./shared/util.js');
 var pdfjsDisplayGlobal = require('./display/global.js');
 var pdfjsDisplayAPI = require('./display/api.js');

+ 2 - 2
lib/pdf.worker.js

@@ -14,7 +14,7 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.504';
-var pdfjsBuild = '0430e99d';
+var pdfjsVersion = '1.9.506';
+var pdfjsBuild = '47789b51';
 var pdfjsCoreWorker = require('./core/worker.js');
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

+ 60 - 0
lib/test/unit/api_spec.js

@@ -735,6 +735,66 @@ describe('api', function () {
         done.fail(reason);
       });
     });
+    describe('Cross-origin', function () {
+      var loadingTask;
+      function _checkCanLoad(expectSuccess, filename, options) {
+        if ((0, _util.isNodeJS)()) {
+          pending('Cannot simulate cross-origin requests in Node.js');
+        }
+        var params = (0, _test_utils.buildGetDocumentParams)(filename, options);
+        var url = new URL(params.url);
+        if (url.hostname === 'localhost') {
+          url.hostname = '127.0.0.1';
+        } else if (params.url.hostname === '127.0.0.1') {
+          url.hostname = 'localhost';
+        } else {
+          pending('Can only run cross-origin test on localhost!');
+        }
+        params.url = url.href;
+        loadingTask = (0, _api.getDocument)(params);
+        return loadingTask.promise.then(function (pdf) {
+          return pdf.destroy();
+        }).then(function () {
+          expect(expectSuccess).toEqual(true);
+        }, function (error) {
+          if (expectSuccess) {
+            expect(error).toEqual('There should not be any error');
+          }
+          expect(expectSuccess).toEqual(false);
+        });
+      }
+      function testCanLoad(filename, options) {
+        return _checkCanLoad(true, filename, options);
+      }
+      function testCannotLoad(filename, options) {
+        return _checkCanLoad(false, filename, options);
+      }
+      afterEach(function (done) {
+        if (loadingTask) {
+          loadingTask.destroy().then(done);
+        } else {
+          done();
+        }
+      });
+      it('server disallows cors', function (done) {
+        testCannotLoad('basicapi.pdf').then(done);
+      });
+      it('server allows cors without credentials, default withCredentials', function (done) {
+        testCanLoad('basicapi.pdf?cors=withoutCredentials').then(done);
+      });
+      it('server allows cors without credentials, and withCredentials=false', function (done) {
+        testCanLoad('basicapi.pdf?cors=withoutCredentials', { withCredentials: false }).then(done);
+      });
+      it('server allows cors without credentials, but withCredentials=true', function (done) {
+        testCannotLoad('basicapi.pdf?cors=withoutCredentials', { withCredentials: true }).then(done);
+      });
+      it('server allows cors with credentials, and withCredentials=true', function (done) {
+        testCanLoad('basicapi.pdf?cors=withCredentials', { withCredentials: true }).then(done);
+      });
+      it('server allows cors with credentials, and withCredentials=false', function (done) {
+        testCanLoad('basicapi.pdf?cors=withCredentials', { withCredentials: false }).then(done);
+      });
+    });
   });
   describe('Page', function () {
     var loadingTask;

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.9.504",
+  "version": "1.9.506",
   "main": "build/pdf.js",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [

Some files were not shown because too many files changed in this diff