From: Simon Ruderich Date: Fri, 2 Aug 2019 19:04:25 +0000 (+0200) Subject: nsscash: force UTC timezone for If-Modified-Since header X-Git-Tag: 0.1~24 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=0ebeb1b4be72405243eadf39f297a13d6d391020;p=nsscash%2Fnsscash.git 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. --- 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]