I want to register urls of the format:
“base/*”
“base/*/*”
“base/*/*/constant1”
“base/*/*/constant1/*”
“base/*/*/constant2”
“base/*/*/constant2/*”
This seemed to work for a while, but after adding a few more routes it seems the routing is getting mixed-up somehow… What exactly does “*” represent? Is it not strictly a non-/ part of a path?
My main problem was actually a bug on my side, but I did notice that a path like “a/b/c” was matching the route “*/*”. Is this a bug or a feature? Is the idea that we can match a route with “two or more” elements?
Yeah, * in HTTP.jl is basically matching a single path segment, not an arbitrary chunk containing /. The problem is likely the overlapping routes, the more generic * routes can end up matching before the ones with constant1 or constant2. I’d make the constant routes more specific and register them before the generic catch-all routes. That usually avoids the routing getting ambiguous as the number of routes grows.