From 5b5230deb7d58214af496de7df3c74e023606aab Mon Sep 17 00:00:00 2001 From: Craig Peterson <192540+captncraig@users.noreply.github.com> Date: Mon, 29 Jan 2024 22:49:40 -0500 Subject: [PATCH] remote client: apply custom headers before sigv4 transport Signed-off-by: Craig Peterson <192540+captncraig@users.noreply.github.com> --- storage/remote/client.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/remote/client.go b/storage/remote/client.go index fbb680498..e765b47c3 100644 --- a/storage/remote/client.go +++ b/storage/remote/client.go @@ -141,24 +141,24 @@ func NewWriteClient(name string, conf *ClientConfig) (WriteClient, error) { } t := httpClient.Transport + if len(conf.Headers) > 0 { + t = newInjectHeadersRoundTripper(conf.Headers, t) + } + if conf.SigV4Config != nil { - t, err = sigv4.NewSigV4RoundTripper(conf.SigV4Config, httpClient.Transport) + t, err = sigv4.NewSigV4RoundTripper(conf.SigV4Config, t) if err != nil { return nil, err } } if conf.AzureADConfig != nil { - t, err = azuread.NewAzureADRoundTripper(conf.AzureADConfig, httpClient.Transport) + t, err = azuread.NewAzureADRoundTripper(conf.AzureADConfig, t) if err != nil { return nil, err } } - if len(conf.Headers) > 0 { - t = newInjectHeadersRoundTripper(conf.Headers, t) - } - httpClient.Transport = otelhttp.NewTransport(t) return &Client{