Merge pull request #14658 from Snuffleupagus/api-validate-cMapUrl-standardFontDataUrl

Validate the `cMapUrl`/`standardFontDataUrl` parameters in `getDocument`
This commit is contained in:
Tim van der Meij 2022-03-11 21:09:58 +01:00 committed by GitHub
commit 790735eaf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -338,6 +338,12 @@ function getDocument(src) {
if (!Number.isInteger(params.maxImageSize)) {
params.maxImageSize = -1;
}
if (typeof params.cMapUrl !== "string") {
params.cMapUrl = null;
}
if (typeof params.standardFontDataUrl !== "string") {
params.standardFontDataUrl = null;
}
if (typeof params.useWorkerFetch !== "boolean") {
params.useWorkerFetch =
params.CMapReaderFactory === DOMCMapReaderFactory &&