Skip to content

Golang client fails to attach to streams with "http: invalid Host header" with go1.20.6, go1.19.11Β #45935

@markusthoemmes

Description

Description

Since updating to Golang 1.20.6, the moby Golang client starts failing with http: invalid Host header errors when used against the default unix socket at least. Normal container operations seem to be fine, but ContainerAttach and ContainerExecAttach fail in particular.

I'm assuming this is related to Golang backporting Host header sanitization into 1.20 via golang/go#61076.

Reproduce

Create a container with the Golang client and try to attach to its streams. I can try to cook up a minimal code example if necessary.

Expected behavior

No response

docker version

github.com/docker/docker v24.0.4+incompatible

docker info

Server:
 Server Version: 23.0.4

Additional Info

No response

Metadata

Assignees

No one assigned

    Labels

    kind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.status/0-triagestatus/needs-attentionCalls for a collective discussion during a review session

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions