Skip to content

Commit 6041fa3

Browse files
authored
Merge pull request #35 from KyberNetwork/ft/http_canonicalise-headers
fix: only set x-client-id in client scope if not already set, not request scope
2 parents b646c75 + cb1808c commit 6041fa3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/client/http.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ func (*HttpCfg) OnUpdate(_, new *HttpCfg) {
2424
r.Header.Set(common.HeaderXRequestId, traceID.String())
2525
}
2626
}
27-
if len(r.Header.Values(common.HeaderXClientId)) == 0 {
28-
r.Header.Set(common.HeaderXClientId, common.GetServiceClientId())
29-
}
3027
return nil
3128
})
29+
if len(new.C.Header.Values(common.HeaderXClientId)) == 0 {
30+
new.C.Header.Set(common.HeaderXClientId, common.GetServiceClientId())
31+
}
3232
if tracer.Provider() != nil {
3333
new.C.SetTransport(otelhttp.NewTransport(new.C.GetClient().Transport))
3434
}

0 commit comments

Comments
 (0)