1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-03 00:56:59 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-05-27 03:10:51 -07:00
parent 3359eae306
commit 466d509e34
4 changed files with 9 additions and 9 deletions

View File

@ -15,11 +15,11 @@ func TestBasicAuth(t *testing.T) {
req := httptest.NewRequest(echo.GET, "/", nil)
res := httptest.NewRecorder()
c := e.NewContext(req, res)
f := func(u, p string, c echo.Context) (error, bool) {
f := func(u, p string, c echo.Context) (bool, error) {
if u == "joe" && p == "secret" {
return nil, true
return true, nil
}
return nil, false
return false, nil
}
h := BasicAuth(f)(func(c echo.Context) error {
return c.String(http.StatusOK, "test")