mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 08:52:27 +02:00
Split port from hostname in full urls.
This commit is contained in:
parent
8385211fa2
commit
1f8b536c8a
|
@ -197,11 +197,11 @@ func (m *DnsMonitor) Add(target string, callback DnsMonitorCallback) (*DnsMonito
|
|||
}
|
||||
hostname = parsed.Host
|
||||
} else {
|
||||
// Hostname with optional port passed.
|
||||
// Hostname only passed.
|
||||
hostname = target
|
||||
if h, _, err := net.SplitHostPort(target); err == nil {
|
||||
hostname = h
|
||||
}
|
||||
if h, _, err := net.SplitHostPort(hostname); err == nil {
|
||||
hostname = h
|
||||
}
|
||||
|
||||
m.mu.Lock()
|
||||
|
|
|
@ -240,7 +240,7 @@ func TestDnsMonitor(t *testing.T) {
|
|||
rec1 := newDnsMonitorReceiverForTest(t)
|
||||
rec1.Expect(ips1, ips1, nil, nil)
|
||||
|
||||
entry1, err := monitor.Add("https://foo", rec1.OnLookup)
|
||||
entry1, err := monitor.Add("https://foo:12345", rec1.OnLookup)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue