controlplane: remove gorilla handlers dependency (#3813)

This commit is contained in:
Caleb Doxsey 2022-12-15 14:41:29 -07:00 committed by GitHub
parent b375dc4896
commit 27c94396a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View file

@ -7,12 +7,12 @@ import (
"time"
"github.com/CAFxX/httpcompression"
gorillahandlers "github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/pomerium/pomerium/config"
"github.com/pomerium/pomerium/internal/handlers"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/middleware"
"github.com/pomerium/pomerium/internal/telemetry"
"github.com/pomerium/pomerium/internal/telemetry/requestid"
)
@ -37,7 +37,7 @@ func (srv *Server) addHTTPMiddleware(root *mux.Router, cfg *config.Config) {
Str("path", r.URL.String()).
Msg("http-request")
}))
root.Use(gorillahandlers.RecoveryHandler())
root.Use(middleware.Recovery)
root.Use(log.RemoteAddrHandler("ip"))
root.Use(log.UserAgentHandler("user_agent"))
root.Use(log.RefererHandler("referer"))