Extract variables in handleHTTPRequest

This commit is contained in:
leahoop 2023-08-29 14:11:26 +08:00
parent dc9cff732e
commit f033d8b5ea

7
gin.go
View File

@ -591,10 +591,11 @@ func (engine *Engine) HandleContext(c *Context) {
func (engine *Engine) handleHTTPRequest(c *Context) {
httpMethod := c.Request.Method
rPath := c.Request.URL.Path
requestURL := c.Request.URL
rPath := requestURL.Path
unescape := false
if engine.UseRawPath && len(c.Request.URL.RawPath) > 0 {
rPath = c.Request.URL.RawPath
if engine.UseRawPath && len(requestURL.RawPath) > 0 {
rPath = requestURL.RawPath
unescape = engine.UnescapePathValues
}