mirror of
https://github.com/gin-gonic/gin.git
synced 2026-09-04 14:49:27 +08:00
Merge c53bdbaf64ed9a46b418ac94572147b1197f9fbf into dcaa4296d111981ffb31ac3eba90bb63e1eb5ab9
This commit is contained in:
commit
28edc07196
3
gin.go
3
gin.go
@ -743,6 +743,9 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
|
||||
if tree.method == httpMethod {
|
||||
continue
|
||||
}
|
||||
// Reset skippedNodes before each getValue call to prevent accumulation
|
||||
// across multiple method trees, which could cause slice bounds panic
|
||||
*c.skippedNodes = (*c.skippedNodes)[:0]
|
||||
if value := tree.root.getValue(rPath, nil, c.skippedNodes, unescape); value.handlers != nil {
|
||||
allowed = append(allowed, tree.method)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user