You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I'm implementing subgroups with httprouter, and applying middleware to specific route groups. Currently, my subware wrapper works simply like this below. Full source is here httprouter/subware.
Httprouter works perfectly in the above example, but a minor issue is that when I'm trying to craft a route with a wildcard, ie router.GET("/protected/*", handle) vs router.GET("/protected/*path", handle), I get the following warning in httprouter/tree.go (~ lines 235)
// check if the wildcard has a nameifend-i<2 {
panic("wildcards must be named with a non-empty name in path '"+fullPath+"'")
}
May I know the side-effects of ignoring this check, beyond losing path as a parameter value in httprouters.Params?
edit: That is, router loses the path parameter in /protected/*path, but I don't really need it. The subrouter would have properly parsed a new set of parameters relevant to the subroutes. For example /protected/user/:id.
Many thanks!
The text was updated successfully, but these errors were encountered:
Hi I'm implementing subgroups with httprouter, and applying middleware to specific route groups. Currently, my subware wrapper works simply like this below. Full source is here httprouter/subware.
Httprouter works perfectly in the above example, but a minor issue is that when I'm trying to craft a route with a wildcard, ie
router.GET("/protected/*", handle)
vsrouter.GET("/protected/*path", handle)
, I get the following warning in httprouter/tree.go (~ lines 235)May I know the side-effects of ignoring this check, beyond losing
path
as a parameter value in httprouters.Params?edit: That is, router loses the
path
parameter in/protected/*path
, but I don't really need it. The subrouter would have properly parsed a new set of parameters relevant to the subroutes. For example/protected/user/:id
.Many thanks!
The text was updated successfully, but these errors were encountered: