Enforce file origin check in annotation PDF viewer

This commit is contained in:
alam00000
2026-10-13 14:12:12 +05:30
parent 3a5f146d1b
commit 46bf0fbb57
3 changed files with 7 additions and 4 deletions
+3
View File
@@ -2,3 +2,6 @@
src/partials/footer.html
blog/posts/
public/pdfjs-viewer/
public/pdfjs-annotation-viewer/
File diff suppressed because one or more lines are too long
@@ -13514,9 +13514,9 @@ initCom(PDFViewerApplication);
return;
}
const fileOrigin = new URL(file, window.location.href).origin;
// if (fileOrigin !== viewerOrigin) {
// throw new Error("file origin does not match viewer's");
// }
if (fileOrigin !== viewerOrigin) {
throw new Error("file origin does not match viewer's");
}
} catch (ex) {
PDFViewerApplication._documentError("pdfjs-loading-error", {
message: ex.message