mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
Update gin.go
the param is not empty in router.
This commit is contained in:
parent
678aaadcd5
commit
bab4425698
8
gin.go
8
gin.go
@ -529,6 +529,14 @@ func (engine *Engine) handleHTTPRequest(c *Context) {
|
|||||||
root := t[i].root
|
root := t[i].root
|
||||||
// Find route in tree
|
// Find route in tree
|
||||||
value := root.getValue(rPath, c.params, unescape)
|
value := root.getValue(rPath, c.params, unescape)
|
||||||
|
|
||||||
|
for _, param := range *value.params {
|
||||||
|
if len(param.Value) < 1 {
|
||||||
|
serveError(c, http.StatusNotFound, default404Body)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if value.params != nil {
|
if value.params != nil {
|
||||||
c.Params = *value.params
|
c.Params = *value.params
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user