Skip to content

Commit

Permalink
Update middleware.go
Browse files Browse the repository at this point in the history
fixed issue #27
  • Loading branch information
RupeshHacker authored Mar 2, 2024
1 parent a606a43 commit 44e4d18
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ import (

// Wrap converts a list of middlewares to nested calls (in reverse order)
func Wrap(handler http.Handler, mws ...func(http.Handler) http.Handler) http.Handler {
if len(mws) == 0 {
return handler
}
res := handler
for i := len(mws) - 1; i >= 0; i-- {
res = mws[i](res)
handler = mws[i](handler)
}
return res
return handler
}


// AppInfo adds custom app-info to the response header
func AppInfo(app, author, version string) func(http.Handler) http.Handler {
f := func(h http.Handler) http.Handler {
Expand Down

0 comments on commit 44e4d18

Please sign in to comment.