[Pkg-javascript-commits] [pdf.js] 195/246: Fix the error handling for CMaps that fail to load

David Prévot taffit at moszumanska.debian.org
Sun Sep 7 15:36:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 9ef0d0b878441aa9ad0dbad3cbce9802cc7bad6d
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Aug 14 16:29:10 2014 +0200

    Fix the error handling for CMaps that fail to load
---
 src/core/cmap.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/cmap.js b/src/core/cmap.js
index 1cdaa03..5d69d17 100644
--- a/src/core/cmap.js
+++ b/src/core/cmap.js
@@ -387,7 +387,7 @@ var BinaryCMapReader = (function BinaryCMapReaderClosure() {
       request.overrideMimeType('text/plain; charset=x-user-defined');
     }
     request.send(null);
-    if (request.status === 0 && /^https?:/i.test(url)) {
+    if (nonBinaryRequest ? !request.responseText : !request.response) {
       error('Unable to get binary cMap at: ' + url);
     }
     if (nonBinaryRequest) {
@@ -927,7 +927,7 @@ var CMapFactory = (function CMapFactoryClosure() {
     var url = builtInCMapParams.url + name;
     request.open('GET', url, false);
     request.send(null);
-    if (request.status === 0 && /^https?:/i.test(url)) {
+    if (!request.responseText) {
       error('Unable to get cMap at: ' + url);
     }
     var cMap = new CMap(true);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list