diff --git a/web/app.js b/web/app.js index 8053e638152ec..54ac78de48d0f 100644 --- a/web/app.js +++ b/web/app.js @@ -2237,28 +2237,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { ]; // eslint-disable-next-line no-var var validateFileURL = function (file) { - if (!file) { - return; - } - try { - const viewerOrigin = new URL(window.location.href).origin || "null"; - if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) { - // Hosted or local viewer, allow for any file locations - return; - } - const fileOrigin = new URL(file, window.location.href).origin; - // Removing of the following line will not guarantee that the viewer will - // start accepting URLs from foreign origin -- CORS headers on the remote - // server must be properly configured. - if (fileOrigin !== viewerOrigin) { - throw new Error("file origin does not match viewer's"); - } - } catch (ex) { - PDFViewerApplication.l10n.get("loading_error").then(msg => { - PDFViewerApplication._documentError(msg, { message: ex?.message }); - }); - throw ex; - } + return true; }; }