mirror of
https://github.com/containers/podman.git
synced 2025-12-11 09:18:34 +08:00
/_ping handler: return OSType http header
The docker client expects to read the OSType header from the `/_ping` response in order to determine the OS type of the server, for example, when running `docker run --device=/dev/fuse ...` https://github.com/moby/moby/blob/master/client/ping.go#L57 Signed-off-by: chnrxn <cohawk@yahoo.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package compat
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/containers/buildah"
|
"github.com/containers/buildah"
|
||||||
)
|
)
|
||||||
@@ -18,6 +19,7 @@ func Ping(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Builder-Version", "")
|
w.Header().Set("Builder-Version", "")
|
||||||
w.Header().Set("Docker-Experimental", "true")
|
w.Header().Set("Docker-Experimental", "true")
|
||||||
w.Header().Set("Cache-Control", "no-cache")
|
w.Header().Set("Cache-Control", "no-cache")
|
||||||
|
w.Header().Set("OSType", runtime.GOOS)
|
||||||
w.Header().Set("Pragma", "no-cache")
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
|
||||||
w.Header().Set("Libpod-Buildah-Version", buildah.Version)
|
w.Header().Set("Libpod-Buildah-Version", buildah.Version)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ t GET /libpod/_ping 200 OK
|
|||||||
t HEAD /libpod/_ping 200
|
t HEAD /libpod/_ping 200
|
||||||
|
|
||||||
t GET _ping 200 OK
|
t GET _ping 200 OK
|
||||||
|
like "$(<$WORKDIR/curl.headers.out)" $'.*\nOstype: ' "#19767 - undocumented part of docker API"
|
||||||
t HEAD _ping 200
|
t HEAD _ping 200
|
||||||
t GET libpod/_ping 200 OK
|
t GET libpod/_ping 200 OK
|
||||||
t HEAD libpod/_ping 200
|
t HEAD libpod/_ping 200
|
||||||
|
|||||||
Reference in New Issue
Block a user