summaryrefslogtreecommitdiff
path: root/pkg/api/server/handler_api.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-16 04:06:30 +0200
committerGitHub <noreply@github.com>2020-09-16 04:06:30 +0200
commit26049193e0829c2ac841ff852732ddb4223a01fb (patch)
tree47ec84131bf8164941e5def9c347210fefc1fc5b /pkg/api/server/handler_api.go
parent32b49463d9f38e6bdf4ad521a4b11fa17d836050 (diff)
parent8a8bae8299dff8d10c0a2f5873190e19a83ea01c (diff)
downloadpodman-26049193e0829c2ac841ff852732ddb4223a01fb.tar.gz
podman-26049193e0829c2ac841ff852732ddb4223a01fb.tar.bz2
podman-26049193e0829c2ac841ff852732ddb4223a01fb.zip
Merge pull request #7642 from jwhonce/issues/7327-2
Refactor API version values
Diffstat (limited to 'pkg/api/server/handler_api.go')
-rw-r--r--pkg/api/server/handler_api.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/api/server/handler_api.go b/pkg/api/server/handler_api.go
index e47b66bb4..f2ce0301b 100644
--- a/pkg/api/server/handler_api.go
+++ b/pkg/api/server/handler_api.go
@@ -40,6 +40,10 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc {
c = context.WithValue(c, "idletracker", s.idleTracker) //nolint
r = r.WithContext(c)
+ v := utils.APIVersion[utils.CompatTree][utils.CurrentAPIVersion]
+ w.Header().Set("API-Version", fmt.Sprintf("%d.%d", v.Major, v.Minor))
+ w.Header().Set("Libpod-API-Version", utils.APIVersion[utils.LibpodTree][utils.CurrentAPIVersion].String())
+
h(w, r)
}
fn(w, r)