fix: explicit allow Origin from request
This commit is contained in:
parent
5a8e69978f
commit
c88e6b4ab3
1 changed files with 5 additions and 1 deletions
|
@ -35,12 +35,16 @@ var DefaultInterceptor = func(h http.HandlerFunc) http.HandlerFunc {
|
|||
})
|
||||
}
|
||||
|
||||
var allowAllOrigins = func(_ string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func CreateRouter(o OpenIDProvider, h HttpInterceptor) *mux.Router {
|
||||
if h == nil {
|
||||
h = DefaultInterceptor
|
||||
}
|
||||
router := mux.NewRouter()
|
||||
router.Use(handlers.CORS())
|
||||
router.Use(handlers.CORS(handlers.AllowedOriginValidator(allowAllOrigins)))
|
||||
router.HandleFunc(healthzEndpoint, Healthz)
|
||||
router.HandleFunc(readinessEndpoint, o.HandleReady)
|
||||
router.HandleFunc(oidc.DiscoveryEndpoint, o.HandleDiscovery)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue