1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 07:38:07 +02:00

Merge pull request #9363 from Rob--W/fetch-http/s-only

Limit PDFFetchStream to http(s) in the Chrome extension
This commit is contained in:
Jonas Jenwald 2018-01-21 11:45:09 +01:00 committed by GitHub
commit fe5102a27f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 17 deletions

View file

@ -85,9 +85,13 @@ function initializePDFJS(callback) {
// Set network stream class for unit tests.
if (typeof Response !== 'undefined' && 'body' in Response.prototype &&
typeof ReadableStream !== 'undefined') {
displayApi.setPDFNetworkStreamClass(PDFFetchStream);
displayApi.setPDFNetworkStreamFactory(function(params) {
return new PDFFetchStream(params);
});
} else {
displayApi.setPDFNetworkStreamClass(PDFNetworkStream);
displayApi.setPDFNetworkStreamFactory(function(params) {
return new PDFNetworkStream(params);
});
}
// Configure the worker.