Skip to content

Instantly share code, notes, and snippets.

@lox
Created November 1, 2018 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lox/7ca4a12667475aac3c495671082332fb to your computer and use it in GitHub Desktop.
Save lox/7ca4a12667475aac3c495671082332fb to your computer and use it in GitHub Desktop.
Test disabling http2

Based on golang/go#13598, I should be able to disable the http2 client with:

GODEBUG=h2client=0 go run get.go
package main
import (
"io/ioutil"
"log"
"net/http"
)
func main() {
res, err := http.Get("https://buildkite.com/")
if err != nil {
log.Fatal(err)
}
log.Printf("Res: %#v", res)
b, err := ioutil.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
log.Printf("Read %d bytes", len(b))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment