mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 12:54:24 +02:00
Use correct timestamp format for Last-Modified header
HTTP uses GMT [1,2] rather than UTC as timezone for timestamps. However, the Last-Modified header used UTC which confused at least wget. Before, UTC was used: $ wget --no-check-certificate -S --spider https://cb_pages_tests.localhost.mock.directory:4430/images/827679288a.jpg ... Last-Modified: Sun, 11 Sep 2022 08:37:42 UTC ... Last-modified header invalid -- time-stamp ignored. ... After, GMT is used: $ wget --no-check-certificate -S --spider https://cb_pages_tests.localhost.mock.directory:4430/images/827679288a.jpg ... Last-Modified: Sun, 11 Sep 2022 08:37:42 GMT ... (no last-modified-header-invalid warning) [1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified [2]: https://www.rfc-editor.org/rfc/rfc9110#name-date-time-formats Fixes #364
This commit is contained in:
parent
17530a065b
commit
59adfc2251
1 changed files with 1 additions and 1 deletions
|
@ -24,5 +24,5 @@ func (o *Options) setHeader(ctx *context.Context, header http.Header) {
|
|||
} else {
|
||||
ctx.RespWriter.Header().Set(gitea.ContentTypeHeader, mime)
|
||||
}
|
||||
ctx.RespWriter.Header().Set(headerLastModified, o.BranchTimestamp.In(time.UTC).Format(time.RFC1123))
|
||||
ctx.RespWriter.Header().Set(headerLastModified, o.BranchTimestamp.In(time.UTC).Format(http.TimeFormat))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue