Merge 6c7a318468ce708b91c1afbf4a32e493d65fab22 into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d

This commit is contained in:
Jim Chen 2025-03-23 09:56:08 +08:00 committed by GitHub
commit d3c9e43a29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

4
gin.go
View File

@ -649,8 +649,8 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
httpMethod := c.Request.Method httpMethod := c.Request.Method
rPath := c.Request.URL.Path rPath := c.Request.URL.Path
unescape := false unescape := false
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 { if engine.UseRawPath {
rPath = c.Request.URL.RawPath rPath = c.Request.URL.EscapedPath()
unescape = engine.UnescapePathValues unescape = engine.UnescapePathValues
} }

View File

@ -242,7 +242,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc {
return func(c *Context) { return func(c *Context) {
// Start timer // Start timer
start := time.Now() start := time.Now()
path := c.Request.URL.Path path := c.Request.URL.EscapedPath()
raw := c.Request.URL.RawQuery raw := c.Request.URL.RawQuery
// Process request // Process request