lib/upgrade: Enable HTTP/2 for upgrade checks (#9060)

This commit is contained in:
Jakob Borg 2023-08-30 21:58:34 +02:00 committed by GitHub
parent abd89f15f7
commit 3130af3773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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
}