Skip to content

Commit

Permalink
fix(timeout): Fix the swagger issue introduce after fixing #2758
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Poignant <[email protected]>
  • Loading branch information
thomaspoignant committed Dec 13, 2024
1 parent e81df19 commit 491023c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/relayproxy/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ func (s *Server) initRoutes() {
)
s.apiEcho.Use(custommiddleware.ZapLogger(s.zapLog, s.config))
s.apiEcho.Use(middleware.BodyDumpWithConfig(middleware.BodyDumpConfig{
Skipper: func(_ echo.Context) bool {
return !s.zapLog.Core().Enabled(zap.DebugLevel)
Skipper: func(c echo.Context) bool {
isSwagger := strings.HasPrefix(c.Request().URL.String(), "/swagger")
return isSwagger || !s.zapLog.Core().Enabled(zap.DebugLevel)
},
Handler: func(_ echo.Context, reqBody []byte, _ []byte) {
s.zapLog.Debug("Request info", zap.ByteString("request_body", reqBody))
Expand Down

0 comments on commit 491023c

Please sign in to comment.