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
Router avoid method conflicts #34
Router avoid method conflicts #34
Conversation
Thanks @fkettelhoit! this is great, and nice catch with the route issue. I'll give this and your other PR a review ASAP. |
testing this on branch
Mind taking a look? |
I haven't deployed the sandbox worker yet, but shouldn't this be the expected behavior? In line 235 the worker uses an (Btw I also noticed that the |
Ah, yes! thank you. Definitely working as expected 😆
Yea I need to rebase this. Thanks! No worries about the signature change.. it's really the right thing to do so we can catch invalid codes.. Do you think it's worth the trade-off? My concern is that it's pretty unlikely that the end-user will defensively attempt to check this error, since |
I was initially a bit torn myself, but I agree that choosing |
Ok, cool. Thank you for the feedback. I'll leave it as-is then and we can reconsider later on! |
Merge PR for #34, add or_else_any_method explicit handlers
Depends on #33
I noticed that I could not add a catchall route
/*whatever
without causing a conflict with an existing route/something
, even if the 2 routes used different HTTP methods. I am not sure whether this is expected behavior, but I thought that it might make sense to check conflicts only for routes with the same HTTP methods, which is what this PR implements.For example, with this PR it is possible to define a
/*whatever
route for OPTIONS requests without causing conflicts with any existing and more specific GET route.