Improve HTTP server.
Linting and tests / Linting (push) Successful in 19s
Linting and tests / Tests (push) Successful in 17s

This commit is contained in:
2026-06-10 10:39:12 +05:00
parent 0db14666d0
commit 7cc06a9ef1
4 changed files with 21 additions and 15 deletions
+5 -5
View File
@@ -49,12 +49,12 @@ func (h *httpServer) configureHTTPServer() error {
}
func (h *httpServer) RegisterHandler(method, path string, handler http.HandlerFunc) {
h.httpMux.HandleFunc(fmt.Sprintf("%s %s", method, path), func(w http.ResponseWriter, r *http.Request) {
//nolint:modernize
for i := len(h.middlewares) - 1; i >= 0; i-- {
handler = h.middlewares[i](handler)
}
//nolint:modernize
for i := len(h.middlewares) - 1; i >= 0; i-- {
handler = h.middlewares[i](handler)
}
h.httpMux.HandleFunc(fmt.Sprintf("%s %s", method, path), func(w http.ResponseWriter, r *http.Request) {
handler(w, r)
})
}