mirror of
https://github.com/labstack/echo.git
synced 2025-04-23 12:18:53 +02:00
param alias, context#param
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
b358b06311
commit
fd9508ca39
@ -237,7 +237,7 @@ func (c *context) SetPath(p string) {
|
|||||||
|
|
||||||
func (c *context) Param(name string) string {
|
func (c *context) Param(name string) string {
|
||||||
for i, n := range c.pnames {
|
for i, n := range c.pnames {
|
||||||
if i < len(c.pnames) {
|
if i < len(c.pvalues) {
|
||||||
if n == name {
|
if n == name {
|
||||||
return c.pvalues[i]
|
return c.pvalues[i]
|
||||||
}
|
}
|
||||||
|
@ -177,8 +177,8 @@ func (r *Router) insert(method, path string, h HandlerFunc, t kind, ppath string
|
|||||||
}
|
}
|
||||||
for i, n := range pnames {
|
for i, n := range pnames {
|
||||||
// Param name aliases
|
// Param name aliases
|
||||||
if !strings.Contains(n, pnames[i]) {
|
if i < len(cn.pnames) && !strings.Contains(cn.pnames[i], n) {
|
||||||
cn.pnames[i] += "," + pnames[i]
|
cn.pnames[i] += "," + n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user