repository
field.mount
.Router.routeNotFound
to enable multiple read()
calls on it.params
is deprecated in favor of Request.params
adding using an extension on Request
.notFoundHandler
now returns a sentinel routeNotFound
response object which causes 404 with the message ‘Route not found’.routeNotFound
response object will be ignored and pattern matching will continue on additional routes/handlers.Changing the router to continue pattern matching additional routes if a matched handler or nested router returns the sentinel routeNotFound
response object is technically a breaking change. However, it only affects scenarios where the request matches a mounted sub-router, but does not match any route on this sub-router. In this case, shelf_router
version 1.0.0
would immediately respond 404, without attempting to match further routes. With this release, the behavior changes to matching additional routes until one returns a custom 404 response object, or all routes have been matched.
This behavior is more in line with how shelf_router
version 0.7.x
worked, and since many affected users consider the behavior from 1.0.0
a defect, we decided to remedy the situation.
null
in shelf
1.0.0, a router will return a default 404 response instead. This behavior can be overridden with the notFoundHandler
constructor parameter.Router.handler
getter. The router itself is a handler.Router.mount
parameter to accept a Handler
.Router
to be considered a Handler
.Router.handler
getter.@sealed
annotation to Router
and Route
.HEAD
handler whenever a GET
handler is registered. Defaulting to calling the GET
handler and throwing away the body.Function
instead of dynamic
in RouterEntry
to improve typing.