From 5343826ec91e039e4016a88accac6139b27c9f04 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sun, 10 Jan 2021 16:11:53 +0100 Subject: [PATCH] Fix --- cache.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cache.go b/cache.go index 01d1ea0..2b1b7bc 100644 --- a/cache.go +++ b/cache.go @@ -132,7 +132,9 @@ func getCache(key string, next http.Handler, r *http.Request) (item *cacheItem) exp, _ := strconv.Atoi(result.Header.Get(cacheInternalExpirationHeader)) lastMod := time.Now() if lm := result.Header.Get("Last-Modified"); lm != "" { - lastMod, _ = dateparse.ParseLocal(lm) + if parsedTime, te := dateparse.ParseLocal(lm); te == nil { + lastMod = parsedTime + } } item = &cacheItem{ expiration: exp,