Define CORSMaxAgeSeconds constant

This commit is contained in:
2026-01-08 02:21:30 -08:00
parent ce25ea8f6f
commit 115f92660d

View File

@@ -18,6 +18,9 @@ import (
"sneak.berlin/go/pixa/internal/logger"
)
// CORSMaxAgeSeconds is the max age for CORS preflight cache (24 hours).
const CORSMaxAgeSeconds = 86400
// MiddlewareParams defines dependencies for Middleware.
type MiddlewareParams struct {
fx.In
@@ -104,7 +107,7 @@ func (s *Middleware) CORS() func(http.Handler) http.Handler {
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"},
ExposedHeaders: []string{"Link"},
AllowCredentials: false,
MaxAge: 86400,
MaxAge: CORSMaxAgeSeconds,
})
}