mirror of https://github.com/jlelse/GoBlog
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))
|
exp, _ := strconv.Atoi(result.Header.Get(cacheInternalExpirationHeader))
|
||||||
lastMod := time.Now()
|
lastMod := time.Now()
|
||||||
if lm := result.Header.Get("Last-Modified"); lm != "" {
|
if lm := result.Header.Get("Last-Modified"); lm != "" {
|
||||||
lastMod, _ = dateparse.ParseLocal(lm)
|
if parsedTime, te := dateparse.ParseLocal(lm); te == nil {
|
||||||
|
lastMod = parsedTime
|
||||||
|
}
|
||||||
}
|
}
|
||||||
item = &cacheItem{
|
item = &cacheItem{
|
||||||
expiration: exp,
|
expiration: exp,
|
||||||
|
|
Loading…
Reference in New Issue