Skip to content

Commit

Permalink
RHINENG-11685: remove gzip middleware debug logging
Browse files Browse the repository at this point in the history
This reverts commit f40e6a8.
  • Loading branch information
Dugowitch committed Aug 28, 2024
1 parent c750f8a commit f21a847
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 29 deletions.
3 changes: 2 additions & 1 deletion manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"app/manager/middlewares"
"app/manager/routes"

"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
)

Expand Down Expand Up @@ -47,7 +48,7 @@ func RunManager() {
app.Use(middlewares.MaxConnections(utils.CoreCfg.MaxGinConnections))
app.Use(middlewares.Ratelimit(utils.CoreCfg.Ratelimit))
app.Use(middlewares.RequestResponseLogger())
app.Use(middlewares.Gzip())
app.Use(gzip.Gzip(gzip.DefaultCompression))
endpointsConfig := getEndpointsConfig()
middlewares.SetSwagger(app, endpointsConfig)
app.Use(middlewares.WithTimeout(utils.CoreCfg.ResponseTimeout))
Expand Down
15 changes: 0 additions & 15 deletions manager/middlewares/gzip.go

This file was deleted.

13 changes: 0 additions & 13 deletions manager/middlewares/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"app/manager/config"
"fmt"
"net/http"
"net/http/httputil"
"strconv"
"strings"

Expand Down Expand Up @@ -193,22 +192,10 @@ func RBAC() gin.HandlerFunc {
}

return func(c *gin.Context) {
tempLogDebugGinContextRequestHeader(c, "RBAC before")
defer tempLogDebugGinContextRequestHeader(c, "RBAC after")
if isAccessGranted(c) {
return
}
c.AbortWithStatusJSON(http.StatusUnauthorized,
utils.ErrorResponse{Error: "You don't have access to this application"})
}
}

func tempLogDebugGinContextRequestHeader(c *gin.Context, origin string) {
if c != nil {
dump, err := httputil.DumpRequest(c.Request, false)
if err != nil {
utils.LogDebug("origin", origin, "err", err.Error(), "gin_context_req", nil, "gin context request handler")
}
utils.LogDebug("origin", origin, "gin_context_req", string(dump), "gin context request handler")
}
}

0 comments on commit f21a847

Please sign in to comment.