docker-client
docker-client copied to clipboard
remove manual RawInputStream wrapper in client.logs()
The manual wrapping is currently necessary due to the remote api always returning text/plain content-type headers, so that the automated behaviour won't work. See https://github.com/docker/docker/issues/16885
As soon as the Docker deamon behaves as expected, the code at dockerClient.logs() can be removed (see https://github.com/gesellix/docker-client/blob/master/src/main/groovy/de/gesellix/docker/client/DockerClientImpl.groovy#L832).
The docs for the current api version 1.41 now explicitly describe the response headers regarding the encoding and content-type:
logs returned as a stream in response body. For the stream format, see the documentation for the attach endpoint. Note that unlike the attach endpoint, the logs endpoint does not upgrade the connection and does not set Content-Type.
I still wonder why the api has such inconsistent behaviour, but at least it's documented since https://github.com/moby/moby/pull/38819.
A possible fix is https://github.com/moby/moby/pull/39812