Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 673c59d

Browse files
committed
Fix WebSocket compression
1 parent ca31d90 commit 673c59d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

coderd/provisionerdaemons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (api *api) provisionerDaemons(rw http.ResponseWriter, r *http.Request) {
5353
// Serves the provisioner daemon protobuf API over a WebSocket.
5454
func (api *api) provisionerDaemonsServe(rw http.ResponseWriter, r *http.Request) {
5555
conn, err := websocket.Accept(rw, r, &websocket.AcceptOptions{
56-
// Need to disable compression to avoid a data-race
56+
// Need to disable compression to avoid a data-race.
5757
CompressionMode: websocket.CompressionDisabled,
5858
})
5959
if err != nil {

codersdk/provisioners.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func (c *Client) ProvisionerDaemonClient(ctx context.Context) (proto.DRPCProvisi
3636
}
3737
conn, res, err := websocket.Dial(ctx, serverURL.String(), &websocket.DialOptions{
3838
HTTPClient: c.httpClient,
39+
// Need to disable compression to avoid a data-race.
40+
CompressionMode: websocket.CompressionDisabled,
3941
})
4042
if err != nil {
4143
if res == nil {

0 commit comments

Comments
 (0)