feat: add cors * to handler

This commit is contained in:
Livio Amstutz 2020-02-27 12:56:47 +01:00
parent 660519a19f
commit 3f97c5c3ed
3 changed files with 11 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"net/http"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"
@ -40,6 +41,7 @@ func CreateRouter(o OpenIDProvider, h HttpInterceptor) *mux.Router {
h = DefaultInterceptor
}
router := mux.NewRouter()
router.Use(handlers.CORS())
router.HandleFunc(healthzEndpoint, Healthz)
router.HandleFunc(readinessEndpoint, o.HandleReady)
router.HandleFunc(oidc.DiscoveryEndpoint, o.HandleDiscovery)