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
Change the way path matching works to be closer to the latest definition from http.ServeMux
Drop the * param in favour of using trailing slashes to indicate rooted trees
Rework the Route syntax to make this apparent
mux.Handle("/", h) should handle all paths without a more exact match, as it does in the go mux. Right now this is only achieved via mux.Handle("/*", h) and requires another definition for the root itself.
mux.Handle("thing", h) and mux.Handle("thing/", h) should differentiate between only an exactly match of thing and thing/* respectively. Without the exact definition, the rooted tree will also match thing directly.
Both thing AND thing/ should be able to be defined separately, as the go mux does, and result in different handlers. Being able to do this with the Route() syntax is challenging.
A possible implementation:
// registers a and b/ with no specific separate b handlermux.Route("a").Route("b/")
// registers a, b, and b/a:=mux.Route("a")
a.Route("b")
a.Route("b/")
This is more confusing when the rooted tree comes in the middle of a chain
// Will register handlers for a, b/, and c, with no specific handler on bmux.Route("a").Route("b/").Route("c")
// Requests to /a/b will go to the b/ handler
The text was updated successfully, but these errors were encountered:
Change the way path matching works to be closer to the latest definition from http.ServeMux
*
param in favour of using trailing slashes to indicate rooted treesRoute
syntax to make this apparentmux.Handle("/", h)
should handle all paths without a more exact match, as it does in the go mux. Right now this is only achieved viamux.Handle("/*", h)
and requires another definition for the root itself.mux.Handle("thing", h)
andmux.Handle("thing/", h)
should differentiate between only an exactly match ofthing
andthing/*
respectively. Without the exact definition, the rooted tree will also matchthing
directly.Both
thing
ANDthing/
should be able to be defined separately, as the go mux does, and result in different handlers. Being able to do this with theRoute()
syntax is challenging.A possible implementation:
This is more confusing when the rooted tree comes in the middle of a chain
The text was updated successfully, but these errors were encountered: