fix: prevent middleware re-entry issue in HandleContext (#3987)

This commit is contained in:
bound2
2025-03-20 17:40:41 +02:00
committed by GitHub
parent e737e3e267
commit 8763f33c65
2 changed files with 40 additions and 0 deletions
+2
View File
@@ -637,10 +637,12 @@ func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// Disclaimer: You can loop yourself to deal with this, use wisely.
func (engine *Engine) HandleContext(c *Context) {
oldIndexValue := c.index
oldHandlers := c.handlers
c.reset()
engine.handleHTTPRequest(c)
c.index = oldIndexValue
c.handlers = oldHandlers
}
func (engine *Engine) handleHTTPRequest(c *Context) {