Skip to content

Commit

Permalink
fix: fix URL path value still unescaped when UnescapePathValues set f…
Browse files Browse the repository at this point in the history
…alse

Closes gin-gonic#4033
  • Loading branch information
jimchen committed Aug 20, 2024
1 parent cc4e114 commit bf6728e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ func (engine *Engine) HandleContext(c *Context) {

func (engine *Engine) handleHTTPRequest(c *Context) {
httpMethod := c.Request.Method
rPath := c.Request.URL.Path
rPath := c.Request.URL.EscapedPath()
unescape := false
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {
rPath = c.Request.URL.RawPath
Expand Down
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,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
Expand Down

0 comments on commit bf6728e

Please sign in to comment.