Skip to content

Commit 591a3b7

Browse files
committed
fix: avoid setting session token header twice
1 parent 0238f29 commit 591a3b7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

codersdk/client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,7 @@ func (c *Client) Dial(ctx context.Context, path string, opts *websocket.DialOpti
354354
if opts.HTTPHeader == nil {
355355
opts.HTTPHeader = http.Header{}
356356
}
357-
if opts.HTTPHeader.Get("tokenHeader") == "" {
358-
opts.HTTPHeader.Set(tokenHeader, c.SessionToken())
359-
}
357+
opts.HTTPHeader.Set(tokenHeader, c.SessionToken())
360358

361359
conn, resp, err := websocket.Dial(ctx, u.String(), opts)
362360
if resp != nil && resp.Body != nil {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy