This commit is contained in:
healthyyyoung 2025-03-21 16:45:51 -07:00 committed by GitHub
commit 883589a4ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}