/_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:
parent
44986f5b10
commit
1b45fd7239
|
|
@ -3,6 +3,7 @@ package compat
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"runtime"
|
||||
|
||||
"github.com/containers/buildah"
|
||||
)
|
||||
|
|
@ -18,6 +19,7 @@ func Ping(w http.ResponseWriter, r *http.Request) {
|
|||
w.Header().Set("Builder-Version", "")
|
||||
w.Header().Set("Docker-Experimental", "true")
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
w.Header().Set("OSType", runtime.GOOS)
|
||||
w.Header().Set("Pragma", "no-cache")
|
||||
|
||||
w.Header().Set("Libpod-Buildah-Version", buildah.Version)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ t GET /libpod/_ping 200 OK
|
|||
t HEAD /libpod/_ping 200
|
||||
|
||||
t GET _ping 200 OK
|
||||
like "$(<$WORKDIR/curl.headers.out)" $'.*\nOstype: ' "#19767 - undocumented part of docker API"
|
||||
t HEAD _ping 200
|
||||
t GET libpod/_ping 200 OK
|
||||
t HEAD libpod/_ping 200
|
||||
|
|
|
|||
Loading…
Reference in New Issue