diff options
author | bt90 <btom1990@googlemail.com> | 2023-09-06 14:36:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 14:36:00 +0200 |
commit | 06ac10ee372840508a03520c94835a582427732c (patch) | |
tree | ce193e3e304775cc58ded5f8f466d58ffea4956d | |
parent | 7c0223bd06de866fbe10ea9e7a5326b1d20096bb (diff) |
cmd/stdiscosrv: Deduplicate addresses (fixes #8482) (#9080)
-rw-r--r-- | cmd/stdiscosrv/apisrv.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/stdiscosrv/apisrv.go b/cmd/stdiscosrv/apisrv.go index 56806ffb2a..0f39f5d1fd 100644 --- a/cmd/stdiscosrv/apisrv.go +++ b/cmd/stdiscosrv/apisrv.go @@ -29,6 +29,7 @@ import ( "time" "github.com/syncthing/syncthing/lib/protocol" + "github.com/syncthing/syncthing/lib/stringutil" ) // announcement is the format received from and sent to clients @@ -440,6 +441,9 @@ func fixupAddresses(remote *net.TCPAddr, addresses []string) []string { fixed = append(fixed, uri.String()) } + // Remove duplicate addresses + fixed = stringutil.UniqueTrimmedStrings(fixed) + return fixed } |