1
0
Fork 0
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:
Yury Delendik 2013-07-12 13:36:20 -05:00
parent ef658bf5f1
commit 28778e6c1b
3 changed files with 30 additions and 22 deletions

View file

@ -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);
},