mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 02:32:43 +01:00
commit
b2c6a6920f
1 changed files with 2 additions and 7 deletions
|
@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
|
|||
return user, name, err
|
||||
}
|
||||
|
||||
a := strings.Split(string(s), ":")
|
||||
if len(a) == 2 {
|
||||
user, name = a[0], a[1]
|
||||
} else {
|
||||
err = errors.New("decode failed")
|
||||
}
|
||||
return user, name, err
|
||||
auth := strings.SplitN(string(s), ":", 2)
|
||||
return auth[0], auth[1], err
|
||||
}
|
||||
|
||||
func BasicAuthEncode(username, password string) string {
|
||||
|
|
Loading…
Reference in a new issue