summaryrefslogtreecommitdiff
path: root/api/server/httputils
diff options
context:
space:
mode:
authorKimMachineGun <geon0250@gmail.com>2018-08-22 11:20:22 +0900
committerKimMachineGun <geon0250@gmail.com>2018-08-22 11:20:22 +0900
commit1377a2ddee3f3a35e242237d4e60c6a9d39fc552 (patch)
treef5cf483d1de6aa438b2091a68747d63df4eb6e3d /api/server/httputils
parentef50da44b30dd041896cfc6be45b777e10cc1d75 (diff)
downloaddocker-1377a2ddee3f3a35e242237d4e60c6a9d39fc552.tar.gz
api/server, dockerversion: modify context key
Signed-off-by: KimMachineGun <geon0250@gmail.com>
Diffstat (limited to 'api/server/httputils')
-rw-r--r--api/server/httputils/httputils.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/api/server/httputils/httputils.go b/api/server/httputils/httputils.go
index 5a6854415c..7303814997 100644
--- a/api/server/httputils/httputils.go
+++ b/api/server/httputils/httputils.go
@@ -12,10 +12,8 @@ import (
"github.com/sirupsen/logrus"
)
-type contextKey string
-
// APIVersionKey is the client's requested API version.
-const APIVersionKey contextKey = "api-version"
+type APIVersionKey struct{}
// APIFunc is an adapter to allow the use of ordinary functions as Docker API endpoints.
// Any function that has the appropriate signature can be registered as an API endpoint (e.g. getVersion).
@@ -83,7 +81,7 @@ func VersionFromContext(ctx context.Context) string {
return ""
}
- if val := ctx.Value(APIVersionKey); val != nil {
+ if val := ctx.Value(APIVersionKey{}); val != nil {
return val.(string)
}