5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 09:30:28 +00:00

Merge pull request #70 from yggdrasil-network/urlfix

Default to previous scheme when url.Parse returns an error
This commit is contained in:
Neil Alexander 2018-04-27 10:26:04 +01:00 committed by GitHub
commit cf2e112ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,10 +313,7 @@ func (c *Core) DEBUG_maybeSendUDPKeys(saddr string) {
func (c *Core) DEBUG_addPeer(addr string) {
u, err := url.Parse(addr)
if err != nil {
panic(err)
}
if len(u.Opaque) == 0 {
if err == nil {
switch strings.ToLower(u.Scheme) {
case "tcp":
c.DEBUG_addTCPConn(u.Host)