From 6c7a318468ce708b91c1afbf4a32e493d65fab22 Mon Sep 17 00:00:00 2001 From: jimchen Date: Wed, 21 Aug 2024 09:45:05 +0800 Subject: [PATCH] fix: fix URL path value still unescaped when UnescapePathValues set false --- gin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gin.go b/gin.go index 7275fecd..c0b8bf34 100644 --- a/gin.go +++ b/gin.go @@ -645,10 +645,10 @@ func (engine *Engine) HandleContext(c *Context) { func (engine *Engine) handleHTTPRequest(c *Context) { httpMethod := c.Request.Method - rPath := c.Request.URL.EscapedPath() + 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 }