Skip to content

Commit 504cd46

Browse files
authored
fix: Check for a response body when dialing the Tailnet WebSocket (#4327)
There was a panic in this code that caused it to fail on error!
1 parent 8940ea1 commit 504cd46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codersdk/workspaceagents.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ func (c *Client) DialWorkspaceAgentTailnet(ctx context.Context, logger slog.Logg
387387
CompressionMode: websocket.CompressionDisabled,
388388
})
389389
if isFirst {
390-
if err != nil && res.StatusCode == http.StatusConflict {
390+
if res != nil && res.StatusCode == http.StatusConflict {
391391
first <- readBodyAsError(res)
392392
return
393393
}

0 commit comments

Comments
 (0)