Backport #32102 by @lunny Fix #31930 and more places which use `http.TimeFormat` wrongly. `http.TimeFormat` requires a UTC time. refer to https://pkg.go.dev/net/http#TimeFormat Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
73066e3f97
commit
af0cab23ea
4 changed files with 8 additions and 3 deletions
|
@ -79,6 +79,7 @@ func ServeSetHeaders(w http.ResponseWriter, opts *ServeHeaderOptions) {
|
|||
httpcache.SetCacheControlInHeader(header, duration)
|
||||
|
||||
if !opts.LastModified.IsZero() {
|
||||
// http.TimeFormat required a UTC time, refer to https://pkg.go.dev/net/http#TimeFormat
|
||||
header.Set("Last-Modified", opts.LastModified.UTC().Format(http.TimeFormat))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue