shelf_router 1.1.4 shelf_router: ^1.1.4 copied to clipboard
A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations.
- Fixed a spelling issue in the pubspec file.
- Added package topics to the pubspec file.
- Require Dart >=2.17.
- Update the pubspec
- Remove trailing slash requirement when using
Router.routeNotFoundto enable multiple
read()calls on it.
paramsis deprecated in favor of
Request.paramsadding using an extension on
- The default
notFoundHandlernow returns a sentinel
routeNotFoundresponse object which causes 404 with the message 'Route not found'.
- Minor breaking: Handlers and sub-routers that return the sentinel
routeNotFoundresponse 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
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,
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
and since many affected users consider the behavior from
1.0.0 a defect,
we decided to remedy the situation.
- Migrate package to null-safety
- Since handlers are not allowed to return
shelf1.0.0, a router will return a default 404 response instead. This behavior can be overridden with the
- Breaking: Remove deprecated
Router.handlergetter. The router itself is a handler.
Router.mountparameter to accept a
Routerto be considered a
- Deprecate the
- Always register a
HEADhandler whenever a
GEThandler is registered. Defaulting to calling the
GEThandler and throwing away the body.
RouterEntryto improve typing.
- Fixed description to fit size recommendations.
- Initial release