github.com/codemac/docker@v1.2.1-0.20150518222241-6a18412d5b9c/integration-cli/docker_api_test.go (about) 1 package main 2 3 import ( 4 "net/http" 5 6 "github.com/go-check/check" 7 ) 8 9 func (s *DockerSuite) TestApiOptionsRoute(c *check.C) { 10 status, _, err := sockRequest("OPTIONS", "/", nil) 11 c.Assert(status, check.Equals, http.StatusOK) 12 c.Assert(err, check.IsNil) 13 } 14 15 func (s *DockerSuite) TestApiGetEnabledCors(c *check.C) { 16 res, body, err := sockRequestRaw("GET", "/version", nil, "") 17 body.Close() 18 c.Assert(err, check.IsNil) 19 c.Assert(res.StatusCode, check.Equals, http.StatusOK) 20 // TODO: @runcom incomplete tests, why old integration tests had this headers 21 // and here none of the headers below are in the response? 22 //c.Log(res.Header) 23 //c.Assert(res.Header.Get("Access-Control-Allow-Origin"), check.Equals, "*") 24 //c.Assert(res.Header.Get("Access-Control-Allow-Headers"), check.Equals, "Origin, X-Requested-With, Content-Type, Accept, X-Registry-Auth") 25 }