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
This is a bit difficult to explain so I'll just use examples. I have a route setup for /users/:user_id which is triggered by the URL app://users/ but not app://users. In the first case, the paramter for user_id is /. It would be nice to see /users and /users/ be treated the same as neither pass the target route.
The text was updated successfully, but these errors were encountered:
What is the expected behavior here? In either case you aren't actually passing a parameter, so it isn't really a match for that route. You mention you'd like them to be treated the same, which makes sense to me only if "/users/" is treated as if it was "/users". I'm pretty sure that's what you're thinking as well, I just wanted to clarify before making any code changes.
Yeah that's right. Both of them lack a :user_id but the one with the trailing slash still triggers the route. So my handlers need to have checks in them to make sure that the ending parameter is not / before continuing. It would be nice to have this filtered out by the router itself.
This is a bit difficult to explain so I'll just use examples. I have a route setup for
/users/:user_id
which is triggered by the URLapp://users/
but notapp://users
. In the first case, the paramter foruser_id
is/
. It would be nice to see/users
and/users/
be treated the same as neither pass the target route.The text was updated successfully, but these errors were encountered: