feat: better loging
/ publish (push) Successful in 3m7s

This commit is contained in:
2026-03-07 19:31:19 +01:00
parent 82e601fd7f
commit 2f7ff28c9a
10 changed files with 2029 additions and 25 deletions
-12
View File
@@ -1,7 +1,6 @@
package server
import (
"fmt"
"io/fs"
"log/slog"
"net/http"
@@ -38,14 +37,3 @@ func registerStatic(mux *http.ServeMux) {
panic(err)
}
}
// cacheMiddleware adds Cache-Control headers to the response.
func cacheMiddleware(maxAge time.Duration) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%.0f", maxAge.Seconds()))
w.Header().Set("Vary", "HX-Request,Accept-Language,Accept-Encoding")
next.ServeHTTP(w, r)
})
}
}