diff --git a/gin.go b/gin.go index d71086d1..88742956 100644 --- a/gin.go +++ b/gin.go @@ -689,8 +689,8 @@ func (engine *Engine) handleHTTPRequest(c *Context) { httpMethod := c.Request.Method rPath := c.Request.URL.Path unescape := false - if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 { - rPath = c.Request.URL.RawPath + if engine.UseRawPath { + rPath = c.Request.URL.EscapedPath() unescape = engine.UnescapePathValues } diff --git a/logger.go b/logger.go index 6441f7ea..3d87208e 100644 --- a/logger.go +++ b/logger.go @@ -270,7 +270,7 @@ func LoggerWithConfig(conf LoggerConfig) HandlerFunc { return func(c *Context) { // Start timer start := time.Now() - path := c.Request.URL.Path + path := c.Request.URL.EscapedPath() raw := c.Request.URL.RawQuery // Process request