chore: set User-Agent on all outgoing HTTP requests (#10867)
It's only polite, and it enables better troubleshooting in situations like weird-ass requests to the upgrades download service. --------- Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -127,6 +127,10 @@ func LongVersionFor(program string) string {
|
||||
return v
|
||||
}
|
||||
|
||||
func UserAgent() string {
|
||||
return fmt.Sprintf(`Syncthing/%s (%s %s-%s)`, strings.TrimPrefix(Version, "v"), runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
|
||||
func TagsList() []string {
|
||||
tags := strings.Split(Tags, ",")
|
||||
if len(tags) == 1 && tags[0] == "" {
|
||||
|
||||
Reference in New Issue
Block a user