mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: remove custom "headers" type, and use "http.Header" instead
Use http.Header, which is more descriptive on intent, and we're already importing the package in the client. Removing the "header" type also fixes various locations where the type was shadowed by local variables named "headers". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -2,6 +2,7 @@ package client // import "github.com/docker/docker/client"
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
@@ -52,8 +53,7 @@ func (cli *Client) ContainerAttach(ctx context.Context, container string, option
|
||||
query.Set("logs", "1")
|
||||
}
|
||||
|
||||
headers := map[string][]string{
|
||||
return cli.postHijacked(ctx, "/containers/"+container+"/attach", query, nil, http.Header{
|
||||
"Content-Type": {"text/plain"},
|
||||
}
|
||||
return cli.postHijacked(ctx, "/containers/"+container+"/attach", query, nil, headers)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user