|
@@ -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.
|
|
// 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
|
|
// 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.
|
|
// 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, "")
|
|
router, err := createRouter(eng, false, true, "")
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
// Insert APIVERSION into the request as a convenience
|
|
// 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)
|
|
router.ServeHTTP(w, req)
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|