Skip to content

Commit f33ccc9

Browse files
committed
Fix wrong last modify time
1 parent 08adbc4 commit f33ccc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/httpcache/httpcache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ func HandleGenericETagTimeCache(req *http.Request, w http.ResponseWriter, etag s
7575
w.Header().Set("Etag", etag)
7676
}
7777
if lastModified != nil && !lastModified.IsZero() {
78-
w.Header().Set("Last-Modified", lastModified.Format(http.TimeFormat))
78+
// http.TimeFormat required a UTC time, refer to https://pkg.go.dev/net/http#TimeFormat
79+
w.Header().Set("Last-Modified", lastModified.UTC().Format(http.TimeFormat))
7980
}
8081

8182
if len(etag) > 0 {

0 commit comments

Comments
 (0)