Add middleware tests

This commit is contained in:
Deluan
2020-01-09 15:56:44 -05:00
committed by Deluan Quintão
parent 3379af4328
commit 6aa6c2d9a5
5 changed files with 160 additions and 121 deletions
+1 -2
View File
@@ -56,8 +56,7 @@ func authenticate(next http.Handler) http.Handler {
switch {
case pass != "":
if strings.HasPrefix(pass, "enc:") {
e := strings.TrimPrefix(pass, "enc:")
if dec, err := hex.DecodeString(e); err == nil {
if dec, err := hex.DecodeString(pass[4:]); err == nil {
pass = string(dec)
}
}