mirror of
https://github.com/containers/podman.git
synced 2025-05-22 09:36:57 +08:00
Refactor API version values
* API-Version header now Major.Minor to support tools parsing this header * Libpod Version updated to 2.0.0 to reflect changes in API field values * API-Version and Libpod-API-Version headers are now included in all results Fixes #7327 * Header support tested against goland 2020.2 and https://www.jetbrains.com/help/idea/docker.html plugin Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user