mirror of
https://github.com/jlelse/GoBlog
synced 2024-06-14 11:47:10 +00:00
Fix
This commit is contained in:
parent
4c87a95e73
commit
5343826ec9
4
cache.go
4
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user