Skip to content
Snippets Groups Projects
Commit 298951f1 authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

fix subfilter return

parent 6215f35f
Branches
No related tags found
No related merge requests found
......@@ -7,7 +7,8 @@ const checkForSubFilter = (pdfBuffer) => {
const matches = pdfBuffer.toString().match(/\/SubFilter\s*\/([\w.]*)/);
const subFilter = Array.isArray(matches) && matches[1];
if (!subFilter) {
throw new errors_1.AppError("Can not find subfilter");
//SubFilter is only available if there is a sig in the pdf
return;
}
const supportedTypes = [
"adbe.pkcs7.detached",
......
......@@ -10,8 +10,7 @@ const verifyPDF = (pdf) => {
(0, generalUtils_1.checkForSubFilter)(pdfBuffer);
}
catch (error) {
//SubFilter is only available if there is a sig in the pdf
return null;
throw new Error(error.message);
}
try {
const { signatureStr, signedData, signatureMeta } = (0, signatureUtils_1.extractSignature)(pdfBuffer);
......
......@@ -7,7 +7,8 @@ export const checkForSubFilter = (pdfBuffer: Buffer) => {
const subFilter = Array.isArray(matches) && matches[1];
if (!subFilter) {
throw new AppError("Can not find subfilter");
//SubFilter is only available if there is a sig in the pdf
return;
}
const supportedTypes = [
......
......@@ -7,8 +7,7 @@ export const verifyPDF = (pdf: Buffer) => {
try {
checkForSubFilter(pdfBuffer);
} catch (error) {
//SubFilter is only available if there is a sig in the pdf
return null;
throw new Error(error.message);
}
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment