mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-14 12:42:51 +02:00
Merge 7dde920178 into 05585e037b
This commit is contained in:
commit
191069d5b3
1 changed files with 2 additions and 4 deletions
|
|
@ -27,12 +27,10 @@ func readCookieFile(path string) (username, password string, err error) {
|
|||
}
|
||||
s := scanner.Text()
|
||||
|
||||
parts := strings.SplitN(s, ":", 2)
|
||||
if len(parts) != 2 {
|
||||
username, password, found := strings.Cut(s, ":")
|
||||
if !found {
|
||||
err = fmt.Errorf("malformed cookie file")
|
||||
return
|
||||
}
|
||||
|
||||
username, password = parts[0], parts[1]
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue