Skip to content

Commit 4690c0f

Browse files
committed
fix(api): use skipPaths
Signed-off-by: Ales Verbic <[email protected]>
1 parent 3b702de commit 4690c0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/api/api.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ func Start(cfg *config.Config) error {
7171
logger.Info("disabling access logs for /healthcheck")
7272
}
7373
accessMiddleware := func(c *gin.Context) {
74+
// Skip handling/logging for specified paths
75+
for _, path := range skipPaths {
76+
if c.Request.URL.Path == path {
77+
return
78+
}
79+
}
7480
accessLogger.Info("request received", "method", c.Request.Method, "path", c.Request.URL.Path, "remote_addr", c.ClientIP())
7581
c.Next()
7682
statusCode := c.Writer.Status()

0 commit comments

Comments
 (0)