mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-27 02:37:10 +01:00
Merge 7dde920178
into 43a870eb9f
This commit is contained in:
commit
883589a4ab
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
Reference in a new issue