From 0ebeb1b4be72405243eadf39f297a13d6d391020 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 2 Aug 2019 21:04:25 +0200 Subject: [PATCH] nsscash: force UTC timezone for If-Modified-Since header This is not strictly required as lastModified is already stored in UTC (servers use UTC for the Last-Modified header). However, it's good practice and prevents copy & past errors in the future. See d71bfc6 ("nsscash: main_test: fix Last-Modified/If-Modified-Since headers", 2019-08-02) for the details. --- fetch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.go b/fetch.go index ba1bbc8..491720a 100644 --- a/fetch.go +++ b/fetch.go @@ -43,7 +43,7 @@ func fetchIfModified(url, ca string, lastModified *time.Time) (int, []byte, erro } if !lastModified.IsZero() { req.Header.Add("If-Modified-Since", - lastModified.Format(http.TimeFormat)) + lastModified.UTC().Format(http.TimeFormat)) } client, ok := clients[ca] -- 2.43.2