Skip to content

Commit

Permalink
api: revert to defaulting to http/1
Browse files Browse the repository at this point in the history
PR #10778 incidentally changed the api http client to connect with
HTTP/2 first. However, the websocket libraries used in `alloc exec`
features don't handle http/2 well, and don't downgrade to http/1
gracefully.

Given that the switch is incidental, and not requested by users.
Furthermore, api consumers can opt-in to forcing http/2 by setting
custom http clients.
  • Loading branch information
Mahmood Ali committed Jul 28, 2021
1 parent 79cd4f8 commit 0c3c559
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ func defaultHttpClient() *http.Client {
MinVersion: tls.VersionTLS12,
}

// Default to http/1: alloc exec/websocket aren't supported in http/2
// well yet: https://github.com/gorilla/websocket/issues/417
transport.ForceAttemptHTTP2 = false

return httpClient
}

Expand Down

0 comments on commit 0c3c559

Please sign in to comment.