Why not delegate to $handler
franzliedke opened this issue · 2 comments
When no valid attribute is present, the middleware could keep delegating after all... Or is there just no sensible use-case?
Asking because middlewares/base-path-router#3 makes me imagine a situation where the router has dynamic prefixes, but no default handler, it could just delegate to its own handler. Using request-handler as that delegate would then lead to a situation where request-handler would need a fallthrough. Isn't that the best place for the defaultHandler? After all, the router isn't useful without request-handler anyway, so it could just rely on the latter for the default handler.
middlewares/filesystem Reader has a continueOnError()
option to continue to inner middlewares instead return a 404-405 response if the file is not found or the method is not allowed. We can include this option here, due in practice, is like a defaultHandler.
I just released v1.3.0 with the continueOnEmpty()
option.