fix cache-expires-ineffassign (#466)

This commit is contained in:
John Wang
2018-07-07 21:38:04 -07:00
committed by William Cheng
parent b380e8f2a9
commit a14e757059
2 changed files with 4 additions and 2 deletions

View File

@@ -427,8 +427,9 @@ func CacheExpires(r *http.Response) time.Time {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {

View File

@@ -438,8 +438,9 @@ func CacheExpires(r *http.Response) time.Time {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {