diff --git a/components/engine/api/server.go b/components/engine/api/server.go index 007c07ddb8..1019521e03 100644 --- a/components/engine/api/server.go +++ b/components/engine/api/server.go @@ -1057,13 +1057,13 @@ func createRouter(eng *engine.Engine, logging, enableCors bool, dockerVersion st // ServeRequest processes a single http request to the docker remote api. // FIXME: refactor this to be part of Server and not require re-creating a new // router each time. This requires first moving ListenAndServe into Server. -func ServeRequest(eng *engine.Engine, apiversion float64, w http.ResponseWriter, req *http.Request) error { +func ServeRequest(eng *engine.Engine, apiversion string, w http.ResponseWriter, req *http.Request) error { router, err := createRouter(eng, false, true, "") if err != nil { return err } // Insert APIVERSION into the request as a convenience - req.URL.Path = fmt.Sprintf("/v%g%s", apiversion, req.URL.Path) + req.URL.Path = fmt.Sprintf("/v%s%s", apiversion, req.URL.Path) router.ServeHTTP(w, req) return nil } diff --git a/components/engine/integration/api_test.go b/components/engine/integration/api_test.go index abbc1a1c59..4c22d54b3d 100644 --- a/components/engine/integration/api_test.go +++ b/components/engine/integration/api_test.go @@ -13,6 +13,7 @@ import ( "github.com/dotcloud/docker/runconfig" "github.com/dotcloud/docker/utils" "io" + "io/ioutil" "net" "net/http" "net/http/httptest" diff --git a/components/engine/integration/server_test.go b/components/engine/integration/server_test.go index 8600e78573..2fe16551dc 100644 --- a/components/engine/integration/server_test.go +++ b/components/engine/integration/server_test.go @@ -691,7 +691,7 @@ func TestDeleteTagWithExistingContainers(t *testing.T) { t.Fatalf("Should only have deleted one untag %d", len(imgs.Data)) } - if untag := imgs.Data[0].Get("Untagged"); untag != unitTestImageID { + if untag := imgs.Data[0].Get("Untagged"); untag != "utest:tag1" { t.Fatalf("Expected %s got %s", unitTestImageID, untag) } }