fix: immediately fail jobs with invalid signature

This commit is contained in:
ThatOneCalculator 2023-07-03 10:29:52 -07:00
parent 4c57a5ffaa
commit f99e8b3726

View File

@ -35,8 +35,11 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
info["@context"] = undefined;
logger.debug(JSON.stringify(info, null, 2));
if (!signature?.keyId) return `Invalid signature: ${signature}`;
if (!signature?.keyId) {
const err = `Invalid signature: ${signature}`;
job.moveToFailed({message: err});
return err;
}
//#endregion
const host = toPuny(new URL(signature.keyId).hostname);