docs
docs copied to clipboard
Configured "HttpHeaders" are not sent by Docker daemon
Issue:
Configured "HttpHeaders" are not sent to the repository.
Documentation:
engine/reference/commandline/cli.md
Docker version
Docker version 19.03.13, build 4484c46d9d
Platform:
Ubuntu 18 & MacOS
Reproducing:
I am running an HTTPS proxy, which performs the SSL termination. It receives the requests from the daemon and forwards an HTTPS request to the GCR project. The proxy logs all HTTP headers it receives.
-
Added
"HttpHeaders": { "MyHeader": "MyValue" }to ~/.docker/config.json, as documented -
Execute
docker --config ~/.docker pull https://my_proxy/my_image:tag -
Proxy logs all received log HTTP Headers. "MyHeader" is not found
INFO[8654] Client header "Connection": "close"
INFO[8654] Client header "User-Agent": "docker/19.03.12 go/go1.13.10 git-commit/48a66213fe kernel/4.19.76-linuxkit os/linux arch/amd64 UpstreamClient(Docker-Client/19.03.12 \\(darwin\\))"
INFO[8654] Client header "Accept-Encoding": "gzip"```
It seems that X-Meta prefix must be added to the headers, wish it was documented somehow :(
Indeed. Doc must be updated.
Thank you this just helped me too! Yes please update the documentation: https://docs.docker.com/engine/reference/commandline/cli/#custom-http-headers - it is very sparse!
Is the markdown somewhere in the repository? If it's something I can contribute a PR to, I'd be happy to!
There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 14 days. This helps our maintainers focus on the active issues.
Prevent issues from auto-closing with a /lifecycle frozen comment.
/lifecycle stale
I still think this might be useful to have (if it's not been added elsewhere). Thank you!
/remove-lifecycle stale
Please add this to the documentation, even more that the example doesn't show the prefix in the sample configuration, which is not only scarce but wrong. It would be appreciated by the next one looking for this.
And for the next lost soul: { "HttpHeaders": { "X-Meta-MyHeader": "MyValue" } }
@Stanislasss Adding this to the documentation will not help, as the current behaviour of docker is to send the Headers with the X-Meta- prefix instead of omitting it.
Did I miss something or is this feature completley broken anyway?
same here if you use the X-Meta- prefix it works spent 2 week trying to figure this out till I found this issue.
by it works I mean the Docker daemon sends the the headers that are prefixed by X-Meta
I've just spent some time figuring this limitation out, at least where it's restricted (I didn't understand why it's needed, though).
https://github.com/moby/moby/blob/2937ee5eb15b436b03a5edcafe1854d8ba4da76a/daemon/server/router/image/image_routes.go#L67
https://github.com/moby/moby/blob/2937ee5eb15b436b03a5edcafe1854d8ba4da76a/daemon/server/router/plugin/plugin_routes.go#L24
This is the PR where it was introduced for the first time, so I just asked a question there:
https://github.com/moby/moby/pull/1627