[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbirdy/develop] Bug 6314: Ensure Date header uses UTC string



commit 230ba97882424d35e12794c45db7c6715fe753f9
Author: Arthur Edelstein <arthuredelstein@xxxxxxxxx>
Date:   Thu Jun 16 16:49:58 2016 -0700

    Bug 6314: Ensure Date header uses UTC string
---
 components/torbirdy.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/components/torbirdy.js b/components/torbirdy.js
index 84ea9c7..d4743e0 100644
--- a/components/torbirdy.js
+++ b/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);
   });
 }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits