From bf4b3e68400fd734bc3aa77f8a674ff671a3a5f5 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 19 Sep 2021 08:14:59 +0200 Subject: [PATCH] httpd: move the check connection middleware before the logger middleware Fixes #543 --- httpd/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpd/server.go b/httpd/server.go index 6cce30e8..327fdffc 100644 --- a/httpd/server.go +++ b/httpd/server.go @@ -868,9 +868,9 @@ func (s *httpdServer) initializeRouter() { s.router = chi.NewRouter() s.router.Use(middleware.RequestID) + s.router.Use(s.checkConnection) s.router.Use(logger.NewStructuredLogger(logger.GetLogger())) s.router.Use(recoverer) - s.router.Use(s.checkConnection) s.router.Use(middleware.GetHead) s.router.Use(middleware.StripSlashes)