mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Rejects incorrect url in download manager
This commit is contained in:
parent
ef658bf5f1
commit
28778e6c1b
3 changed files with 30 additions and 22 deletions
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals URL*/
|
||||
/* globals URL, PDFJS */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -59,6 +59,10 @@ var DownloadManager = (function DownloadManagerClosure() {
|
|||
|
||||
DownloadManager.prototype = {
|
||||
downloadUrl: function DownloadManager_downloadUrl(url, filename) {
|
||||
if (!PDFJS.isValidUrl(url, true)) {
|
||||
return; // restricted/invalid URL
|
||||
}
|
||||
|
||||
download(url + '#pdfjs.action=download', filename);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue