diff options
author | Jakob Borg <jakob@kastelo.net> | 2023-08-30 21:58:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 21:58:34 +0200 |
commit | 3130af377340bdbb2ebdf7017e49868ab60b8742 (patch) | |
tree | 39af86697da69e32c43a79ee7220598e0676903a | |
parent | abd89f15f7644c8297f4703a1bec986e1a81e0cd (diff) | |
download | syncthing-3130af377340bdbb2ebdf7017e49868ab60b8742.tar.gz syncthing-3130af377340bdbb2ebdf7017e49868ab60b8742.zip |
lib/upgrade: Enable HTTP/2 for upgrade checks (#9060)
-rw-r--r-- | lib/upgrade/upgrade_supported.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/upgrade/upgrade_supported.go b/lib/upgrade/upgrade_supported.go index 74b1ae899..b43654d7e 100644 --- a/lib/upgrade/upgrade_supported.go +++ b/lib/upgrade/upgrade_supported.go @@ -30,6 +30,7 @@ import ( "github.com/syncthing/syncthing/lib/dialer" "github.com/syncthing/syncthing/lib/signature" + "golang.org/x/net/http2" ) const DisabledByCompilation = false @@ -75,8 +76,12 @@ var insecureHTTP = &http.Client{ }, } +func init() { + _ = http2.ConfigureTransport(insecureHTTP.Transport.(*http.Transport)) +} + func insecureGet(url, version string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) + req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, err } |