From f033d8b5ea906d8ea3743f19521a603536a339dc Mon Sep 17 00:00:00 2001 From: leahoop Date: Tue, 29 Aug 2023 14:11:26 +0800 Subject: [PATCH] Extract variables in handleHTTPRequest --- gin.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gin.go b/gin.go index ed8b6dad..51eeea54 100644 --- a/gin.go +++ b/gin.go @@ -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 }