mirror of https://github.com/gin-gonic/gin.git
fix re-enter middleware bug
This commit is contained in:
parent
d4a64265f2
commit
89988e183a
2
gin.go
2
gin.go
|
@ -583,10 +583,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
|
||||
oldHandles := c.handlers
|
||||
c.reset()
|
||||
engine.handleHTTPRequest(c)
|
||||
|
||||
c.index = oldIndexValue
|
||||
c.handlers = oldHandles
|
||||
}
|
||||
|
||||
func (engine *Engine) handleHTTPRequest(c *Context) {
|
||||
|
|
Loading…
Reference in New Issue