Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Feb 12, 2024
1 parent 8f25353 commit b93f07c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/dkim/dkim-verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ class DkimVerifier extends MessageParser {
this.bodyHashes.set(signatureHeader.bodyHashKey, dkimBody(signatureHeader.bodyCanon, signatureHeader.hashAlgo, signatureHeader.maxBodyLength));
}

let contentTypeHeader = this.headers.parsed.findLast(header => header.key === 'content-type');
let headersArray = this.headers.parsed;
const findLastMethod = typeof headersArray.findLast === 'function' ? headersArray.findLast : headersArray.find;
if (typeof headersArray.findLast !== 'function') {
headersArray = [].concat(headersArray).reverse();
}
const contentTypeHeader = findLastMethod.call(headersArray, header => header.key === 'content-type');
if (contentTypeHeader) {
let line = contentTypeHeader.line.toString();
if (line.indexOf(':') >= 0) {
Expand Down

0 comments on commit b93f07c

Please sign in to comment.