diff --git a/CHANGELOG.md b/CHANGELOG.md index b819742925f..21ecee3dcdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)] diff --git a/api/api.go b/api/api.go index d2deff27478..7ce7d9a1368 100644 --- a/api/api.go +++ b/api/api.go @@ -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 diff --git a/vendor/github.com/hashicorp/nomad/api/api.go b/vendor/github.com/hashicorp/nomad/api/api.go index d2deff27478..7ce7d9a1368 100644 --- a/vendor/github.com/hashicorp/nomad/api/api.go +++ b/vendor/github.com/hashicorp/nomad/api/api.go @@ -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