mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
make sync
This commit is contained in:
10
vendor/github.com/hashicorp/nomad/api/api.go
generated
vendored
10
vendor/github.com/hashicorp/nomad/api/api.go
generated
vendored
@@ -155,6 +155,8 @@ type Config struct {
|
||||
//
|
||||
// TLSConfig is ignored if HttpClient is set.
|
||||
TLSConfig *TLSConfig
|
||||
|
||||
Header http.Header
|
||||
}
|
||||
|
||||
// ClientConfig copies the configuration with a new client address, region, and
|
||||
@@ -527,6 +529,7 @@ type request struct {
|
||||
body io.Reader
|
||||
obj interface{}
|
||||
ctx context.Context
|
||||
header http.Header
|
||||
}
|
||||
|
||||
// setQueryOptions is used to annotate the request with
|
||||
@@ -612,6 +615,8 @@ func (r *request) toHTTP() (*http.Request, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header = r.header
|
||||
|
||||
// Optionally configure HTTP basic authentication
|
||||
if r.url.User != nil {
|
||||
username := r.url.User.Username()
|
||||
@@ -649,6 +654,7 @@ func (c *Client) newRequest(method, path string) (*request, error) {
|
||||
Path: u.Path,
|
||||
RawPath: u.RawPath,
|
||||
},
|
||||
header: make(http.Header),
|
||||
params: make(map[string][]string),
|
||||
}
|
||||
if c.config.Region != "" {
|
||||
@@ -671,6 +677,10 @@ func (c *Client) newRequest(method, path string) (*request, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if c.config.Header != nil {
|
||||
r.header = c.config.Header
|
||||
}
|
||||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user