Define CORSMaxAgeSeconds constant
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user