mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 14:11:14 +00:00
Move CORS handler wrapping into cmd/apiserver and switch config flag to a list of allowed origins
This commit is contained in:
@@ -55,11 +55,7 @@ func Handle(storage map[string]RESTStorage, codec runtime.Codec, prefix string)
|
||||
mux := http.NewServeMux()
|
||||
group.InstallREST(mux, prefix)
|
||||
InstallSupport(mux)
|
||||
handler := RecoverPanics(mux)
|
||||
if enableCORS {
|
||||
handler = CORS(handler, []string{".*"}, nil, nil, "true")
|
||||
}
|
||||
return &defaultAPIServer{handler, group}
|
||||
return &defaultAPIServer{RecoverPanics(mux), group}
|
||||
}
|
||||
|
||||
// APIGroup is a http.Handler that exposes multiple RESTStorage objects
|
||||
|
Reference in New Issue
Block a user