fix: move implementation to "internal" package
Some checks failed
Build Docker Image / Build-Docker-Image (push) Has been cancelled

This commit is contained in:
2025-05-29 13:23:13 +02:00
parent 9bb0cc475d
commit 0c40680d76
72 changed files with 245 additions and 230 deletions

View File

@@ -0,0 +1,14 @@
package middleware
import "net/http"
// Chain list of handlers together.
func Wrapper(next http.Handler, handlers ...func(http.Handler) http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
lastHandler := next
for _, handler := range handlers {
lastHandler = handler(lastHandler)
}
lastHandler.ServeHTTP(w, r)
})
}