diff --git a/api/server/server_linux.go b/api/server/server_linux.go index eac3b5c57561b..6cf2c3f1859d9 100644 --- a/api/server/server_linux.go +++ b/api/server/server_linux.go @@ -27,7 +27,7 @@ func NewServer(proto, addr string, job *engine.Job) (Server, error) { } func setupUnixHttp(addr string, job *engine.Job) (*HttpServer, error) { - r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version")) + r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version")) if err := syscall.Unlink(addr); err != nil && !os.IsNotExist(err) { return nil, err diff --git a/daemon/config.go b/daemon/config.go index 3b7df61068c9c..9a709c0d21d54 100644 --- a/daemon/config.go +++ b/daemon/config.go @@ -69,7 +69,7 @@ func (config *Config) InstallFlags() { flag.BoolVar(&config.EnableSelinuxSupport, []string{"-selinux-enabled"}, false, "Enable selinux support") flag.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, "Set the containers network MTU") flag.StringVar(&config.SocketGroup, []string{"G", "-group"}, "docker", "Group for the unix socket") - flag.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "#-api-enable-cors"}, false, "Enable CORS headers in the remote API") + flag.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "#-api-enable-cors"}, false, "Enable CORS headers in the remote API, this is deprecated by --api-cors-header") flag.StringVar(&config.CorsHeaders, []string{"-api-cors-header"}, "", "Set CORS headers in the remote API") opts.IPVar(&config.DefaultIp, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports") opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options") diff --git a/docs/sources/reference/api/docker_remote_api_v1.17.md b/docs/sources/reference/api/docker_remote_api_v1.17.md index 933bc4438d85a..96887559c23c1 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.17.md +++ b/docs/sources/reference/api/docker_remote_api_v1.17.md @@ -1971,4 +1971,4 @@ This might change in the future. To set cross origin requests to the remote api, please add flag "--api-enable-cors" when running docker in daemon mode. - $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/docs/sources/reference/api/docker_remote_api_v1.18.md b/docs/sources/reference/api/docker_remote_api_v1.18.md index 72d184115b0d1..8fe621814fac7 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.18.md +++ b/docs/sources/reference/api/docker_remote_api_v1.18.md @@ -1975,7 +1975,8 @@ This might change in the future. ## 3.3 CORS Requests -To enable cross origin requests to the remote api add the flag -"--api-enable-cors" when running docker in daemon mode. +To set cross origin requests to the remote api please give values to +"--api-cors-header" when running docker in daemon mode. Set * will allow all, +default or blank means CORS disabled - $ docker -d -H="192.168.1.9:2375" --api-enable-cors + $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar"