|
@@ -5,6 +5,7 @@ import (
|
|
|
"net/http"
|
|
|
"runtime"
|
|
|
|
|
|
+ "github.com/docker/docker/api/server/httputils"
|
|
|
"github.com/docker/docker/api/types/versions"
|
|
|
"golang.org/x/net/context"
|
|
|
)
|
|
@@ -57,8 +58,7 @@ func (v VersionMiddleware) WrapHandler(handler func(ctx context.Context, w http.
|
|
|
if versions.GreaterThan(apiVersion, v.defaultVersion) {
|
|
|
return versionUnsupportedError{version: apiVersion, maxVersion: v.defaultVersion}
|
|
|
}
|
|
|
- // nolint: golint
|
|
|
- ctx = context.WithValue(ctx, "api-version", apiVersion)
|
|
|
+ ctx = context.WithValue(ctx, httputils.APIVersionKey, apiVersion)
|
|
|
return handler(ctx, w, r, vars)
|
|
|
}
|
|
|
|