1
0
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:
Vishal Rana 2015-09-01 12:09:08 -07:00
parent e0a40f864c
commit 9db442492a

View File

@ -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)
}
}