This commit is contained in:
Jan-Lukas Else 2021-01-10 16:11:53 +01:00
parent 4c87a95e73
commit 5343826ec9
1 changed files with 3 additions and 1 deletions

View File

@ -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,