mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Dockerd: enable CORS when only --api-cors-header
is used
Even though the flag `--api-enable-cors` is deprecated in favor of `--api-cors-header`. Using only `--api-cors-header` does not enable CORS. Make changes to 'cmd/dockerd/daemon.go' to enable cors if either of the above flags is set. Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
This commit is contained in:
parent
a048e131be
commit
f0f673f4d5
1 changed files with 1 additions and 1 deletions
|
@ -511,7 +511,7 @@ func (cli *DaemonCli) initMiddlewares(s *apiserver.Server, cfg *apiserver.Config
|
|||
vm := middleware.NewVersionMiddleware(v, api.DefaultVersion, api.MinVersion)
|
||||
s.UseMiddleware(vm)
|
||||
|
||||
if cfg.EnableCors {
|
||||
if cfg.EnableCors || cfg.CorsHeaders != "" {
|
||||
c := middleware.NewCORSMiddleware(cfg.CorsHeaders)
|
||||
s.UseMiddleware(c)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue