mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-26 06:49:28 +08:00
fix: fix URL path value still unescaped when UnescapePathValues set false
Closes #4033
This commit is contained in:
parent
cc4e11438c
commit
bf6728e53b
2
gin.go
2
gin.go
@ -645,7 +645,7 @@ 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.Path
|
rPath := c.Request.URL.EscapedPath()
|
||||||
unescape := false
|
unescape := false
|
||||||
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {
|
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {
|
||||||
rPath = c.Request.URL.RawPath
|
rPath = c.Request.URL.RawPath
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user