Fix badly encoded etag value

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

View File

@@ -172,14 +172,8 @@ func (s *Server) ServeSPA(w http.ResponseWriter, r *http.Request) {
return
}
w.Header().Set("ETag", etag)
if matchETag := r.Header.Get("If-None-Match"); matchETag != "" {
if matchETag == etag {
w.WriteHeader(http.StatusNotModified)
return
}
}
quotedETag := `"` + etag + `"`
w.Header().Set("ETag", quotedETag)
if strings.HasSuffix(path, ".js") || strings.HasSuffix(path, ".css") ||
strings.HasSuffix(path, ".png") || strings.HasSuffix(path, ".jpg") ||