Skip to content

Commit

Permalink
api: revert to defaulting to http/1 (#10958)
Browse files Browse the repository at this point in the history
* api: revert to defaulting to http/1

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.

Fixes #10922
  • Loading branch information
Mahmood Ali committed Jul 28, 2021
1 parent 26e0e4b commit d3835a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .changelog/10958.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

```release-note:bug
api: Reverted to using http/1 to fix a 1.1.2 regression in `alloc exec` sessions
```
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 d3835a1

Please sign in to comment.