1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Static as middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-02-18 22:50:40 -08:00
parent 91ae93ebfc
commit 19d51dad4c
8 changed files with 121 additions and 121 deletions

View File

@ -23,7 +23,7 @@ const (
// For valid credentials it calls the next handler.
// For invalid credentials, it sends "401 - Unauthorized" response.
func BasicAuth(fn BasicAuthFunc, options ...*BasicAuthOptions) echo.MiddlewareFunc {
return func(h echo.Handler) echo.Handler {
return func(next echo.Handler) echo.Handler {
return echo.HandlerFunc(func(c echo.Context) error {
// Skip WebSocket
if (c.Request().Header().Get(echo.Upgrade)) == echo.WebSocket {