]> git.parisson.com Git - pdf.js.git/commitdiff
FTP protocol support (#1165)
authornotmasteryet <async.processingjs@yahoo.com>
Fri, 3 Feb 2012 03:06:13 +0000 (21:06 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Fri, 3 Feb 2012 03:06:13 +0000 (21:06 -0600)
src/core.js

index cb601398e90a6275736ca3b5109df2a70d539779..a34954ab170b72ce997e642349b21b3e19abd520 100644 (file)
@@ -33,7 +33,8 @@ function getPdf(arg, callback) {
   var xhr = new XMLHttpRequest();
   xhr.open('GET', params.url);
   xhr.mozResponseType = xhr.responseType = 'arraybuffer';
-  xhr.expected = (params.url.indexOf('file:') === 0) ? 0 : 200;
+  xhr.expected = (params.url.indexOf('http:') === 0 ||
+                  params.url.indexOf('https:') === 0) ? 200 : 0;
 
   if ('progress' in params)
     xhr.onprogress = params.progress || undefined;