Fallback handlers on nested routers returning 404
I'm trying to do an upgrade from axum-0.6.11 to axum-0.6.20 and I noticed that the behavior we were relying on in 0.6.11, where a nested handler could designate a fallback, seems to not work in 0.6.20.
I've got a test case in this repository:
https://github.com/maxburke/axum-test
With axum-0.6.11, curl -v http://localhost:3000/nest/ returns 200 + "Hello World", but with axum-0.6.20, the same curl command returns 404 + empty response.
Does that code even compile? (can't check, on mobile)
That example code passes a MethodRouter instead of a handler function to fallback.
Yup, it compiles. Changing the fallback to .fallback(root_handler) gives the same result.
I have independently reproduced this.
@Protryon do you wanna share your repro or is it secret? 😅
@Protryon do you wanna share your repro or is it secret? 😅
It's not public, but the TL;DR was a nested router that had a route for / and /*var pointing to the same routes. GET /xyz and GET /xyz/t worked, but GET /xyz/ didn't. I reverted to 0.6.11, and it fixed itself. Fallbacks similarly didn't work for this use case, but worked in 0.6.11.