Skip to content
Permalink
Browse files
Bug 6314: Ensure Date header uses UTC string
  • Loading branch information
arthuredelstein committed Jun 17, 2016
1 parent 1319ae8 commit 230ba97882424d35e12794c45db7c6715fe753f9
Showing with 5 additions and 3 deletions.
  1. +5 −3 components/torbirdy.js
@@ -392,9 +392,11 @@ function sanitizeDateHeaders() {
let roundedDate = new Date(date.getTime());
// Round down to the nearest minute.
roundedDate.setSeconds(0);
// Use the headeremitter's addDate function to format it properly.
// `this` magically refers to the headeremitter object.
this.addDate(roundedDate);
// Use the headeremitter's internal `addText` function to inject the
// Date header. `this` magically refers to the headeremitter object.
// Date.toUTCString() produces an RFC 1123-formatted date string.
// We replace the "GMT" symbol with "+0000" because it is preferred.
this.addText(roundedDate.toUTCString().replace(/GMT$/, "+0000"), false);
});
}

0 comments on commit 230ba97

Please sign in to comment.