fix: fix URL path value still unescaped when UnescapePathValues set false

This commit is contained in:
jimchen 2024-08-21 09:45:05 +08:00
parent bf6728e53b
commit 6c7a318468
1 changed files with 3 additions and 3 deletions

6
gin.go
View File

@ -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
}