Add flag to enable cross domain requests in Api

Add the -api-enable-cors flag when running docker
in daemon mode to allow CORS requests to be made to
the Remote Api.  The default value is false for this
flag to not allow cross origin request to be made.

Also added a handler for OPTIONS requests the standard
for cross domain requests is to initially make an
OPTIONS request to the api.
This commit is contained in:
Michael Crosby
2013-06-03 21:39:00 -04:00
parent 10ef4f7f39
commit 6d5bdff394
5 changed files with 56 additions and 6 deletions
+8
View File
@@ -1056,3 +1056,11 @@ Here are the steps of 'docker run' :
In this first version of the API, some of the endpoints, like /attach, /pull or /push uses hijacking to transport stdin,
stdout and stderr on the same socket. 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.
docker -d -H="192.168.1.9:4243" -api-enable-cors