diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-20 20:10:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 20:10:51 +0200 |
commit | b0bfa0e6da7d1cb0673328cdcff18329ca18cabf (patch) | |
tree | 226b022eb0d7aef35ad65dcaa10c6a2ec9f56e7c /pkg/api/handlers/compat/ping.go | |
parent | 09f8f14b4f7d09946d3d5cfc5460ec9923f7da59 (diff) | |
parent | f9c392f50a631a181bc2aa194b9c46504506d657 (diff) | |
download | podman-b0bfa0e6da7d1cb0673328cdcff18329ca18cabf.tar.gz podman-b0bfa0e6da7d1cb0673328cdcff18329ca18cabf.tar.bz2 podman-b0bfa0e6da7d1cb0673328cdcff18329ca18cabf.zip |
Merge pull request #6271 from jwhonce/wip/version
V2 API Version Support
Diffstat (limited to 'pkg/api/handlers/compat/ping.go')
-rw-r--r-- | pkg/api/handlers/compat/ping.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/ping.go b/pkg/api/handlers/compat/ping.go index 6e77e270f..abee3d8e8 100644 --- a/pkg/api/handlers/compat/ping.go +++ b/pkg/api/handlers/compat/ping.go @@ -5,22 +5,22 @@ import ( "net/http" "github.com/containers/buildah" - "github.com/containers/libpod/pkg/api/handlers" + "github.com/containers/libpod/pkg/api/handlers/utils" ) // Ping returns headers to client about the service // // This handler must always be the same for the compatibility and libpod URL trees! // Clients will use the Header availability to test which backend engine is in use. +// Note: Additionally handler supports GET and HEAD methods func Ping(w http.ResponseWriter, r *http.Request) { - w.Header().Set("API-Version", handlers.DefaultApiVersion) + w.Header().Set("API-Version", utils.ApiVersion[utils.CompatTree][utils.CurrentApiVersion].String()) w.Header().Set("BuildKit-Version", "") w.Header().Set("Docker-Experimental", "true") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Pragma", "no-cache") - // API-Version and Libpod-API-Version may not always be equal - w.Header().Set("Libpod-API-Version", handlers.DefaultApiVersion) + w.Header().Set("Libpod-API-Version", utils.ApiVersion[utils.LibpodTree][utils.CurrentApiVersion].String()) w.Header().Set("Libpod-Buildha-Version", buildah.Version) w.WriteHeader(http.StatusOK) |