mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Moved auth header outside of the block
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
e0a40f864c
commit
9db442492a
@ -39,11 +39,11 @@ func BasicAuth(fn BasicValidateFunc) echo.HandlerFunc {
|
||||
if fn(cred[:i], cred[i+1:]) {
|
||||
return nil
|
||||
}
|
||||
c.Response().Header().Set(echo.WWWAuthenticate, Basic + " realm=Restricted")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
c.Response().Header().Set(echo.WWWAuthenticate, Basic + " realm=Restricted")
|
||||
return echo.NewHTTPError(http.StatusUnauthorized)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user