Releases: dimfeld/httptreemux
Make LookupResult.Params public
Add CaseInsensitive routing option
Thanks to @Russman12 for the PR!
Add RouteData to Request Context before other middleware run
This allows middleware to do things like look at parameters and see the matched pattern. Thanks to @ninthclowd for the PR!
Add AddRouteToContext method
Just adding a helper function to assist in writing handler tests.
Add ContextRoute method. Efficiency fix on Context data
The internal contextData type now uses a pointer receiver to avoid copying it on every access. Also added a ContextRoute helper method to directly extract the Route string if that's all you need. Thanks again to @stuartclan for the help!
Place the unexpanded route path in the request Context
This is mostly to allow logging middleware to show the actual route matched without expanded wildcards.
Request context data can now be accessed using httptreemux.ContextData(r.Context())
, which returns an interface ContextRouteData containing the parameters and the route path. The old ContextParams
method is no longer recommended, but will continue to exist and work as before.
Thanks to @stuartclan for the suggestion and help with the implementation and review!
Add Middleware Support
Middleware is now officially supported. Documentation coming soon. Many thanks to @vmihailenco for the PR and @kravemir for help with the review!
Add Go Module Support
No code changes. This release just adds support for Go Modules. Thanks @SamWhited for the PR!
Fix doubly-escaped characters when redirecting
When redirecting from a URL like /The%20Path/
, the URL was incorrectly escaped again, redirecting to /The%2520Path
.
Thanks to @Backfighter for the detailed bug report!
Use PathUnescape on Go 1.8+
Go 1.7 and below continues to use UrlUnescape. I bumped the major version since this is a breaking change, but I doubt anyone will complain.