From fdbb3f1e66912a62e848bdcbbb18fb35a9d245f3 Mon Sep 17 00:00:00 2001 From: Marcos Nils <1578458+marcosnils@users.noreply.github.com> Date: Mon, 2 Dec 2024 00:34:52 -0300 Subject: [PATCH] remove localhost CORS as it's not needed anymore (#637) fixes #636 Signed-off-by: Marcos Lilljedahl --- handlers/bootstrap.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handlers/bootstrap.go b/handlers/bootstrap.go index 727dac2..48e7162 100644 --- a/handlers/bootstrap.go +++ b/handlers/bootstrap.go @@ -69,8 +69,7 @@ func Register(extend HandlerExtender) { corsRouter := mux.NewRouter() corsHandler := gh.CORS(gh.AllowCredentials(), gh.AllowedHeaders([]string{"x-requested-with", "content-type"}), gh.AllowedMethods([]string{"GET", "POST", "HEAD", "DELETE"}), gh.AllowedOriginValidator(func(origin string) bool { - if strings.Contains(origin, "localhost") || - strings.HasSuffix(origin, ".play-with-docker.com") || + if strings.HasSuffix(origin, ".play-with-docker.com") || strings.HasSuffix(origin, ".play-with-kubernetes.com") || strings.HasSuffix(origin, ".docker.com") || strings.HasSuffix(origin, ".play-with-go.dev") {