Skip to content

Commit

Permalink
lib/upgrade: Enable HTTP/2 for upgrade checks (syncthing#9060)
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh authored Aug 30, 2023
1 parent abd89f1 commit 3130af3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/upgrade/upgrade_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 3130af3

Please sign in to comment.