Matcha v1.2.2
Changes
- Partial routes no longer consider non-alphanumeric paths invalid (no issue)
- Giving Matcha a nil handler now results in a
501 Not Implemented
response instead of a panic when trying to call nil handlers (#100)
Developer Notes
This patch squashes some bugs found during internal work with Matcha. The first flew under the radar since running into it required usage of a set of previously-niche functionality, brought into play more by the introduction of Router.Mount
. We'd like to introduce some tools for request validation beyond per-part regex validation, but it wasn't right to leave it as an invisible check behind all partials.
The nil handler problem is a bit of a half-fix, and that's by design. Matcha removes control from the user outside of middleware and request handlers; ideally, this control is given back for common cases outside of those, like we do with handlers for 404
when no routes are matched. However, this functionality is provided so that production applications can readily access tools that they should be using. Production APIs should not have nil
handlers. If you need more specific behavior, implement that in a handler and register it instead of nil
.
What's Next
A break, and then a round of features! Looking at more middleware options and validation for requests as candidates.