remove unused code in BasicAuthDecode

tokarchuk/v1.17
Mageti 10 years ago
parent b7ebbb4064
commit e321469884
  1. 9
      modules/base/tool.go

@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
return user, name, err return user, name, err
} }
a := strings.SplitN(string(s), ":", 2) auth := strings.SplitN(string(s), ":", 2)
if len(a) != 2 { return auth[0], auth[1], err
err = errors.New("decode failed")
} else {
user, name = a[0], a[1]
}
return user, name, err
} }
func BasicAuthEncode(username, password string) string { func BasicAuthEncode(username, password string) string {

Loading…
Cancel
Save