summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorMageti <etienne@mageti.fr>2014-12-10 11:01:17 +0100
committerMageti <etienne@mageti.fr>2014-12-10 11:01:17 +0100
commite321469884c6a775fc0b639d276234daed1ef591 (patch)
tree6fd4a121131a7fc6b702828b793006ffcfac0043 /modules/base
parentb7ebbb4064942ca5013207eb89c4e2dd045ba3ce (diff)
downloadgitea-e321469884c6a775fc0b639d276234daed1ef591.tar.gz
gitea-e321469884c6a775fc0b639d276234daed1ef591.zip
remove unused code in BasicAuthDecode
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/tool.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index 39d3e8abdc..3c435fbdb1 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
return user, name, err
}
- a := strings.SplitN(string(s), ":", 2)
- if len(a) != 2 {
- err = errors.New("decode failed")
- } else {
- user, name = a[0], a[1]
- }
- return user, name, err
+ auth := strings.SplitN(string(s), ":", 2)
+ return auth[0], auth[1], err
}
func BasicAuthEncode(username, password string) string {