cmd/syncthing: Set User-Agent on upgrade checks

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3093
This commit is contained in:
Jakob Borg 2016-05-13 14:11:59 +00:00
parent e8b4286c93
commit bef2425025

View File

@ -79,7 +79,8 @@ func insecureGet(url, version string) (*http.Response, error) {
if err != nil {
return nil, err
}
req.Header.Set("X-Syncthing-Version", version)
req.Header.Set("User-Agent", fmt.Sprintf(`syncthing %s (%s %s-%s)`, version, runtime.Version(), runtime.GOOS, runtime.GOARCH))
return insecureHTTP.Do(req)
}