Signed-off-by: harry zhang <resouer@163.com>
| ... | ... |
@@ -27,7 +27,7 @@ func NewServer(proto, addr string, job *engine.Job) (Server, error) {
|
| 27 | 27 |
} |
| 28 | 28 |
|
| 29 | 29 |
func setupUnixHttp(addr string, job *engine.Job) (*HttpServer, error) {
|
| 30 |
- r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version"))
|
|
| 30 |
+ r := createRouter(job.Eng, job.GetenvBool("Logging"), job.GetenvBool("EnableCors"), job.Getenv("CorsHeaders"), job.Getenv("Version"))
|
|
| 31 | 31 |
|
| 32 | 32 |
if err := syscall.Unlink(addr); err != nil && !os.IsNotExist(err) {
|
| 33 | 33 |
return nil, err |
| ... | ... |
@@ -69,7 +69,7 @@ func (config *Config) InstallFlags() {
|
| 69 | 69 |
flag.BoolVar(&config.EnableSelinuxSupport, []string{"-selinux-enabled"}, false, "Enable selinux support")
|
| 70 | 70 |
flag.IntVar(&config.Mtu, []string{"#mtu", "-mtu"}, 0, "Set the containers network MTU")
|
| 71 | 71 |
flag.StringVar(&config.SocketGroup, []string{"G", "-group"}, "docker", "Group for the unix socket")
|
| 72 |
- flag.BoolVar(&config.EnableCors, []string{"#api-enable-cors", "#-api-enable-cors"}, false, "Enable CORS headers in the remote API")
|
|
| 72 |
+ 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")
|
|
| 73 | 73 |
flag.StringVar(&config.CorsHeaders, []string{"-api-cors-header"}, "", "Set CORS headers in the remote API")
|
| 74 | 74 |
opts.IPVar(&config.DefaultIp, []string{"#ip", "-ip"}, "0.0.0.0", "Default IP when binding container ports")
|
| 75 | 75 |
opts.ListVar(&config.GraphOptions, []string{"-storage-opt"}, "Set storage driver options")
|
| ... | ... |
@@ -1971,4 +1971,4 @@ This might change in the future. |
| 1971 | 1971 |
To set cross origin requests to the remote api, please add flag "--api-enable-cors" |
| 1972 | 1972 |
when running docker in daemon mode. |
| 1973 | 1973 |
|
| 1974 |
- $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" |
|
| 1974 |
+ $ docker -d -H="192.168.1.9:2375" --api-enable-cors |
| ... | ... |
@@ -1975,7 +1975,8 @@ This might change in the future. |
| 1975 | 1975 |
|
| 1976 | 1976 |
## 3.3 CORS Requests |
| 1977 | 1977 |
|
| 1978 |
-To enable cross origin requests to the remote api add the flag |
|
| 1979 |
-"--api-enable-cors" when running docker in daemon mode. |
|
| 1978 |
+To set cross origin requests to the remote api please give values to |
|
| 1979 |
+"--api-cors-header" when running docker in daemon mode. Set * will allow all, |
|
| 1980 |
+default or blank means CORS disabled |
|
| 1980 | 1981 |
|
| 1981 |
- $ docker -d -H="192.168.1.9:2375" --api-enable-cors |
|
| 1982 |
+ $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" |