diff --git a/go.mod b/go.mod index 9aece5c75..c5a10e535 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/aws/aws-sdk-go v1.53.10 github.com/ezamriy/gorpm v0.0.0-20160905202458-25f7273cbf51 github.com/getkin/kin-openapi v0.124.0 - github.com/gin-contrib/gzip v1.0.1 github.com/gin-contrib/timeout v1.0.1 github.com/gin-gonic/gin v1.10.0 github.com/gocarina/gocsv v0.0.0-20240520201108-78e41c74b4b1 @@ -49,6 +48,7 @@ require ( github.com/cloudwego/iasm v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/gabriel-vasile/mimetype v1.4.4 // indirect + github.com/gin-contrib/gzip v1.0.1 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect diff --git a/manager/manager.go b/manager/manager.go index f80892c4b..84f45521b 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -47,7 +47,6 @@ func RunManager() { app.Use(middlewares.MaxConnections(utils.CoreCfg.MaxGinConnections)) app.Use(middlewares.Ratelimit(utils.CoreCfg.Ratelimit)) app.Use(middlewares.RequestResponseLogger()) - app.Use(middlewares.Gzip()) endpointsConfig := getEndpointsConfig() middlewares.SetSwagger(app, endpointsConfig) app.Use(middlewares.WithTimeout(utils.CoreCfg.ResponseTimeout)) diff --git a/manager/middlewares/gzip.go b/manager/middlewares/gzip.go deleted file mode 100644 index fa61bfeed..000000000 --- a/manager/middlewares/gzip.go +++ /dev/null @@ -1,15 +0,0 @@ -package middlewares - -import ( - "github.com/gin-contrib/gzip" - "github.com/gin-gonic/gin" -) - -func Gzip(options ...gzip.Option) gin.HandlerFunc { - gzipFn := gzip.Gzip(gzip.DefaultCompression, options...) - return func(c *gin.Context) { - tempLogDebugGinContextRequestHeader(c, "Gzip before") - defer tempLogDebugGinContextRequestHeader(c, "Gzip after") - gzipFn(c) - } -} diff --git a/manager/middlewares/rbac.go b/manager/middlewares/rbac.go index b43e36652..a7bde75aa 100644 --- a/manager/middlewares/rbac.go +++ b/manager/middlewares/rbac.go @@ -8,7 +8,6 @@ import ( "app/manager/config" "fmt" "net/http" - "net/http/httputil" "strconv" "strings" @@ -193,8 +192,6 @@ func RBAC() gin.HandlerFunc { } return func(c *gin.Context) { - tempLogDebugGinContextRequestHeader(c, "RBAC before") - defer tempLogDebugGinContextRequestHeader(c, "RBAC after") if isAccessGranted(c) { return } @@ -202,13 +199,3 @@ func RBAC() gin.HandlerFunc { 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") - } -} diff --git a/platform/platform.go b/platform/platform.go index 4b01bb903..b351e8fb1 100644 --- a/platform/platform.go +++ b/platform/platform.go @@ -16,7 +16,6 @@ import ( "sync" "time" - "github.com/gin-contrib/gzip" "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/redhatinsights/identity" @@ -183,7 +182,6 @@ func platformMock() { utils.LogInfo("Platform mock starting") app := gin.New() app.Use(middlewares.RequestResponseLogger()) - app.Use(gzip.Gzip(gzip.DefaultCompression)) initVMaaS(app) initRbac(app)