Define CORSMaxAgeSeconds constant
This commit is contained in:
1 parent
ce25ea8f6f
commit
115f92660d
1 file changed
+4
-1
@@ -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