1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-03 22:59:09 +02:00

Updated auth test

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-05-12 06:18:49 -07:00
parent cccaa1ee26
commit 0da05cb7f2
2 changed files with 8 additions and 3 deletions

View File

@@ -19,7 +19,6 @@ func BasicAuth(fn AuthFunc) echo.HandlerFunc {
return func(c *echo.Context) (he *echo.HTTPError) {
auth := c.Request.Header.Get(echo.Authorization)
i := 0
l := len(Basic)
he = &echo.HTTPError{Code: http.StatusUnauthorized}
for ; i < len(auth); i++ {
@@ -30,7 +29,7 @@ func BasicAuth(fn AuthFunc) echo.HandlerFunc {
}
// Check scheme
if i < l {
if i < len(Basic) {
// Ignore case
if i == 0 {
if c != Basic[i] && c != 'b' {