mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-19 18:58:50 +08:00
use UTC timezone for modified time
This commit is contained in:
parent
9b74a53e51
commit
da4b321381
@ -66,7 +66,10 @@ func (fsrv *FileServer) directoryListing(ctx context.Context, fileSystem fs.FS,
|
||||
}
|
||||
|
||||
// keep track of the most recently modified item in the listing
|
||||
modTime := info.ModTime()
|
||||
// this time is used for the Last-Modified header and comparing If-Modified-Since from client
|
||||
// both are expected to be in UTC, so we convert to UTC here
|
||||
// see: https://github.com/caddyserver/caddy/issues/6828
|
||||
modTime := info.ModTime().UTC()
|
||||
if tplCtx.lastModified.IsZero() || modTime.After(tplCtx.lastModified) {
|
||||
tplCtx.lastModified = modTime
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user