mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
cmd/discosrv: Accept host names in announced addresses
GitHub-Pull-Request: https://github.com/syncthing/discosrv/pull/48
This commit is contained in:
parent
ff0cd413e6
commit
b1205db7ac
@ -329,10 +329,12 @@ func (s *querysrv) handleAnnounce(ctx context.Context, remote net.IP, deviceID p
|
||||
}
|
||||
|
||||
ip := net.ParseIP(host)
|
||||
if len(ip) == 0 || ip.IsUnspecified() {
|
||||
uri.Host = net.JoinHostPort(remote.String(), port)
|
||||
if host == "" || ip.IsUnspecified() {
|
||||
host = remote.String()
|
||||
}
|
||||
|
||||
uri.Host = net.JoinHostPort(host, port)
|
||||
|
||||
if err := s.updateAddress(ctx, tx, deviceID, uri.String()); err != nil {
|
||||
internalErr = err
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user