Skip to content

Commit 2535847

Browse files
authored
2.x: Backport: Trim whitespace to ensure date parsing will work (#478)
Backport of #455.
1 parent 4ea0524 commit 2535847

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/dkimVerifier.jsm.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,8 @@ var Verifier = (function() {
11021102
if (recDateTimeStart === -1) {
11031103
log.warn("Could not find the date time in the Received header: "+receivedHeaders[0]);
11041104
} else {
1105-
const recDateTimeStr = receivedHeaders[0].substring(recDateTimeStart + 1);
1105+
// Trim all surrounding whitespace to avoid parsing problems.
1106+
const recDateTimeStr = receivedHeaders[0].substring(recDateTimeStart + 1).trim();
11061107
receivedTime = new Date(recDateTimeStr);
11071108
if (receivedTime.toString() === "Invalid Date") {
11081109
log.warn("Could not parse the date time in the Received header");

0 commit comments

Comments
 (0)