mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
lib/upgrade: Enable HTTP/2 for upgrade checks (#9060)
This commit is contained in:
parent
abd89f15f7
commit
3130af3773
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user