We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd4efa3 commit 0d91678Copy full SHA for 0d91678
p2p/dnsdisc/tree.go
@@ -344,11 +344,11 @@ func parseLink(e string) (*linkEntry, error) {
344
return nil, fmt.Errorf("wrong/missing scheme 'enrtree' in URL")
345
}
346
e = e[len(linkPrefix):]
347
- pos := strings.IndexByte(e, '@')
348
- if pos == -1 {
+
+ keystring, domain, found := strings.Cut(e, "@")
349
+ if !found {
350
return nil, entryError{"link", errNoPubkey}
351
- keystring, domain := e[:pos], e[pos+1:]
352
keybytes, err := b32format.DecodeString(keystring)
353
if err != nil {
354
return nil, entryError{"link", errBadPubkey}
0 commit comments