fix HTTP logging so true path is printed

This commit is contained in:
Benson Wong
2024-12-20 11:25:01 -08:00
parent 84b667ca7a
commit da5d9e8a6a

View File

@@ -51,16 +51,17 @@ func New(config *Config) *ProxyManager {
// Start timer
start := time.Now()
// capture these because /upstream/:model rewrites them in c.Next()
clientIP := c.ClientIP()
method := c.Request.Method
path := c.Request.URL.Path
// Process request
c.Next()
// Stop timer
duration := time.Since(start)
// Log request details
clientIP := c.ClientIP()
method := c.Request.Method
path := c.Request.URL.Path
statusCode := c.Writer.Status()
bodySize := c.Writer.Size()