-
-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Include router option that prevents over writing routes #792
Comments
hi there, so chi does allow overwriting routes. I understand it can be a bit confusing when this happens unintentionally, but, it's very useful when you need it. Perhaps we add some kind of "Options" to a router, and we could specify if we want to allow overwriting routes or not, and if not, then would panic. |
Yes, having that option would be fantastic!
…On Sun, Feb 5, 2023 at 7:59 AM Peter Kieltyka ***@***.***> wrote:
hi there, so chi does allow overwriting routes. I understand it can be a
bit confusing when this happens unintentionally, but, it's very useful when
you need it. Perhaps we add some kind of "Options" to a router, and we
could specify if we want to allow overwriting routes or not, and if not,
then would panic.
—
Reply to this email directly, view it on GitHub
<#792 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEA36MIFUXXK37JMIURYRTWV7E4PANCNFSM6AAAAAAUQYHFUE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@pkieltyka I was looking for something similar! +1 for this, but in addition to adding an option for panicking, how about a separate function similar to I use chi as a reverse proxy that dynamically adds routes, and i would like to check if that particular route/pattern is already taken (and which one if possible). |
@pkieltyka Is there still a plan to add this? |
hi, this is not planned |
I discovered a scenario where you can create two handlers that handle the same pattern but the second one "overwrites" the first one.
The expected behavior would be to panic. Because the pattern
GET /things
being attempted to be added twiceThe example below I would not expect to panic because there are no overlapping URL patterns. The are
GET /things
andGET /things/other
For a
GET /things
the response will beother things
The text was updated successfully, but these errors were encountered: