mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-29 23:06:19 +01:00
commit
b2c6a6920f
@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
|
|||||||
return user, name, err
|
return user, name, err
|
||||||
}
|
}
|
||||||
|
|
||||||
a := strings.Split(string(s), ":")
|
auth := strings.SplitN(string(s), ":", 2)
|
||||||
if len(a) == 2 {
|
return auth[0], auth[1], err
|
||||||
user, name = a[0], a[1]
|
|
||||||
} else {
|
|
||||||
err = errors.New("decode failed")
|
|
||||||
}
|
|
||||||
return user, name, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func BasicAuthEncode(username, password string) string {
|
func BasicAuthEncode(username, password string) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user