sdk: header map copy to avoid race condition in #10301

This commit is contained in:
Chris Baker
2021-04-06 18:04:56 +00:00
parent 4e25e8e235
commit 6064867251
3 changed files with 5 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ IMPROVEMENTS:
BUG FIXES:
* agent: Only allow querying Prometheus formatted metrics if Prometheus is enabled within the config [[GH-10140](https://github.com/hashicorp/nomad/pull/10140)]
* api: Fixed race condition around headers in API client [[GH-10302](https://github.com/hashicorp/nomad/issues/10302)]
* api: Added missing devices block to AllocatedTaskResources [[GH-10064](https://github.com/hashicorp/nomad/pull/10064)]
* cli: Fixed a bug where non-int proxy port would panic CLI [[GH-10072](https://github.com/hashicorp/nomad/issues/10072)]
* cli: Fixed a bug where `nomad operator debug` incorrectly parsed https Consul API URLs. [[GH-10082](https://github.com/hashicorp/nomad/pull/10082)]

View File

@@ -685,8 +685,8 @@ func (c *Client) newRequest(method, path string) (*request, error) {
}
}
if c.config.Headers != nil {
r.header = c.config.Headers
for key, values := range c.config.Headers {
r.header[key] = values
}
return r, nil

View File

@@ -685,8 +685,8 @@ func (c *Client) newRequest(method, path string) (*request, error) {
}
}
if c.config.Headers != nil {
r.header = c.config.Headers
for key, values := range c.config.Headers {
r.header[key] = values
}
return r, nil