mirror of
https://github.com/gin-gonic/gin.git
synced 2026-11-23 11:33:37 +08:00
Merge c53bdbaf64ed9a46b418ac94572147b1197f9fbf into 5c6a15f8f9566612076bd209e623861bf92a6283
This commit is contained in:
commit
b337f42cf7
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