fix(server): use http.TimeFormat for Last-Modified header (#5219)

Navidrome returns Last-Modified values like `Fri, 12 Dec 2025 03:32:26
UTC`. This is invalid according to RFC 7231 which requires HTTP dates to
use GMT instead of UTC. Switch to http.TimeFormat instead of
time.RFC1123 to resolve the issue.
This commit is contained in:
Simon Teixidor
2026-03-17 13:04:47 +01:00
committed by GitHub
parent 2f5b2b5135
commit 8f05f7815e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ func (pub *Router) handleImages(w http.ResponseWriter, r *http.Request) {
defer imgReader.Close()
w.Header().Set("Cache-Control", "public, max-age=315360000")
w.Header().Set("Last-Modified", lastUpdate.Format(time.RFC1123))
w.Header().Set("Last-Modified", lastUpdate.Format(http.TimeFormat))
cnt, err := io.Copy(w, imgReader)
if err != nil {
log.Warn(ctx, "Error sending image", "count", cnt, err)
+1 -1
View File
@@ -81,7 +81,7 @@ func (api *Router) GetCoverArt(w http.ResponseWriter, r *http.Request) (*respons
defer imgReader.Close()
w.Header().Set("cache-control", "public, max-age=315360000")
w.Header().Set("last-modified", lastUpdate.Format(time.RFC1123))
w.Header().Set("last-modified", lastUpdate.Format(http.TimeFormat))
cnt, err := io.Copy(w, imgReader)
if err != nil {