Fix missing cache-control when cache mactch

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-02-02 12:12:35 +01:00
committed by Émile Ré
parent fb6a2d5c4e
commit 0fb2d3c6c9

View File

@@ -183,6 +183,13 @@ func (s *Server) ServeSPA(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "public, max-age=3600")
}
if matchETag := r.Header.Get("If-None-Match"); matchETag != "" {
if matchETag == quotedETag {
w.WriteHeader(http.StatusNotModified)
return
}
}
http.FileServer(s.spaFS).ServeHTTP(w, r)
}