Merge pull request #12 from caos/cors

feat: add cors * to handler
This commit is contained in:
livio-a 2020-02-27 13:04:15 +01:00 committed by GitHub
commit d25ffbe029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 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)