mirror of
https://github.com/gin-gonic/gin.git
synced 2025-04-06 03:57:46 +08:00
fix: fix URL path value still unescaped when UnescapePathValues set false
This commit is contained in:
parent
bf6728e53b
commit
6c7a318468
6
gin.go
6
gin.go
@ -645,10 +645,10 @@ func (engine *Engine) HandleContext(c *Context) {
|
|||||||
|
|
||||||
func (engine *Engine) handleHTTPRequest(c *Context) {
|
func (engine *Engine) handleHTTPRequest(c *Context) {
|
||||||
httpMethod := c.Request.Method
|
httpMethod := c.Request.Method
|
||||||
rPath := c.Request.URL.EscapedPath()
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user