From 0d17ef63236e3a26cbdb75a8840b6bed9c6b1b3f Mon Sep 17 00:00:00 2001 From: Patrik Segedy Date: Fri, 16 Aug 2024 14:39:24 +0200 Subject: [PATCH] RHINENG-11685: debug only gin context request header Unable to read entry, failed to marshal fields to JSON, json: unsupported type: func() (io.ReadCloser, error)Failed to fire hook: failed to marshal fields to JSON, json: unsupported type: func() (io.ReadCloser, error) --- manager/middlewares/rbac.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/middlewares/rbac.go b/manager/middlewares/rbac.go index 31f8105b6..1fd723814 100644 --- a/manager/middlewares/rbac.go +++ b/manager/middlewares/rbac.go @@ -108,7 +108,7 @@ func isAccessGranted(c *gin.Context) bool { utils.LogDebug("response_headers", res.Header, "request_headers", res.Request.Header, "isAccessGranted rbac") } if c.Request != nil { - utils.LogDebug("gin_context_req", *c.Request, "isAccessGranted rbac") + utils.LogDebug("gin_context_req_header", c.Request.Header, "isAccessGranted rbac") } if res != nil && res.Body != nil { defer res.Body.Close() @@ -202,7 +202,7 @@ func RBAC() gin.HandlerFunc { return } if c.Request != nil { - utils.LogDebug("context_req", c.Request, "RBAC") + utils.LogDebug("context_req_header", c.Request.Header, "RBAC") } c.AbortWithStatusJSON(http.StatusUnauthorized, utils.ErrorResponse{Error: "You don't have access to this application"})