mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 21:00:52 +08:00
fix(request_logging): update logging conditions to include only /v1 paths
This commit is contained in:
@@ -19,7 +19,12 @@ import (
|
|||||||
func RequestLoggingMiddleware(logger logging.RequestLogger) gin.HandlerFunc {
|
func RequestLoggingMiddleware(logger logging.RequestLogger) gin.HandlerFunc {
|
||||||
return func(c *gin.Context) {
|
return func(c *gin.Context) {
|
||||||
path := c.Request.URL.Path
|
path := c.Request.URL.Path
|
||||||
if strings.HasPrefix(path, "/v0/management") || path == "/keep-alive" {
|
shouldLog := false
|
||||||
|
if strings.HasPrefix(path, "/v1") {
|
||||||
|
shouldLog = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if !shouldLog {
|
||||||
c.Next()
|
c.Next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user