mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-21 15:48:06 +02:00
Deprecate the isValidUrl
utility function and replace it with createValidAbsoluteUrl
/isValidProtocal
functions instead, since the main URL validation is now done using the new URL
constructor
This commit is contained in:
parent
42f07c6262
commit
71a781ee5c
7 changed files with 49 additions and 31 deletions
|
@ -67,10 +67,9 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC || CHROME')) {
|
|||
|
||||
DownloadManager.prototype = {
|
||||
downloadUrl: function DownloadManager_downloadUrl(url, filename) {
|
||||
if (!pdfjsLib.isValidUrl(url, true)) {
|
||||
if (!pdfjsLib.createValidAbsoluteUrl(url, 'http://example.com')) {
|
||||
return; // restricted/invalid URL
|
||||
}
|
||||
|
||||
download(url + '#pdfjs.action=download', filename);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue