Skip to content

Commit d389b31

Browse files
Swap merging priority
1 parent ae20bfb commit d389b31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

auth.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ func (b authBase) withAuth(ctx context.Context, opt authOption, options ...authO
6464

6565
h := signalling.NewHTTPHeaderWithToken(token)
6666
ctxH, _ := twirp.HTTPRequestHeaders(ctx)
67+
ctxH = ctxH.Clone()
6768

6869
// merge new header with the ones already present in the context
69-
for k, vv := range ctxH {
70+
for k, vv := range h {
7071
for _, v := range vv {
71-
h.Add(k, v)
72+
ctxH.Add(k, v)
7273
}
7374
}
7475

75-
return twirp.WithHTTPRequestHeaders(ctx, h)
76+
return twirp.WithHTTPRequestHeaders(ctx, ctxH)
7677
}

0 commit comments

Comments
 (0)