Skip to content

Commit 9150e37

Browse files
committed
fix: skip healthcheck paths in middleware if configured
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 3b702de commit 9150e37

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/api/api.go

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

0 commit comments

Comments
 (0)