1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

client: deprecate client.CustomHTTPHeaders()

This function was added in a754d89b40, but not
used. Currently, the only consumer of this function I could find was docker/cli,
which used it in a unit-test (this test has already been updated to not depend
on this function); https://grep.app/search?q=.CustomHTTPHeaders%28%29&filter[lang][0]=Go

Given that commit a68ae4a2d9 deprecated the
corresponding client.SetCustomHTTPHeaders() function, and because there is no
active use for this function, it should be ok to deprecate.

We can include this in a patch-release (to be sure nobody else is depending on
it, and (if someone is) to notify them of the deprecation.

As a follow-up to this commit, I'll remove both functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-07-29 13:35:28 +02:00
parent 5e498e20f7
commit 8afb57e633
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -282,6 +282,7 @@ func ParseHostURL(host string) (*url.URL, error) {
} }
// CustomHTTPHeaders returns the custom http headers stored by the client. // CustomHTTPHeaders returns the custom http headers stored by the client.
// Deprecated: this function was unused, and will be removed in the next release.
func (cli *Client) CustomHTTPHeaders() map[string]string { func (cli *Client) CustomHTTPHeaders() map[string]string {
m := make(map[string]string) m := make(map[string]string)
for k, v := range cli.customHTTPHeaders { for k, v := range cli.customHTTPHeaders {