fix: add authorization to cors
This commit is contained in:
parent
6e71c17f1d
commit
d053d8ae48
1 changed files with 5 additions and 1 deletions
|
@ -44,7 +44,11 @@ func CreateRouter(o OpenIDProvider, h HttpInterceptor) *mux.Router {
|
||||||
h = DefaultInterceptor
|
h = DefaultInterceptor
|
||||||
}
|
}
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
router.Use(handlers.CORS(handlers.AllowedOriginValidator(allowAllOrigins), handlers.AllowedHeaders([]string{"content-type"})))
|
router.Use(handlers.CORS(
|
||||||
|
handlers.AllowCredentials(),
|
||||||
|
handlers.AllowedHeaders([]string{"authorization", "content-type"}),
|
||||||
|
handlers.AllowedOriginValidator(allowAllOrigins),
|
||||||
|
))
|
||||||
router.HandleFunc(healthzEndpoint, Healthz)
|
router.HandleFunc(healthzEndpoint, Healthz)
|
||||||
router.HandleFunc(readinessEndpoint, o.HandleReady)
|
router.HandleFunc(readinessEndpoint, o.HandleReady)
|
||||||
router.HandleFunc(oidc.DiscoveryEndpoint, o.HandleDiscovery)
|
router.HandleFunc(oidc.DiscoveryEndpoint, o.HandleDiscovery)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue