Skip to content

Releases: dimfeld/httptreemux

Make LookupResult.Params public

26 Oct 23:50
c997a2a
Compare
Choose a tag to compare

Thanks @devillexio for the PR!

Add CaseInsensitive routing option

07 Oct 01:07
ce8677c
Compare
Choose a tag to compare

Add RouteData to Request Context before other middleware run

30 Mar 06:30
b61bfc4
Compare
Choose a tag to compare

This allows middleware to do things like look at parameters and see the matched pattern. Thanks to @ninthclowd for the PR!

Add AddRouteToContext method

24 Apr 02:41
ebfe087
Compare
Choose a tag to compare

Just adding a helper function to assist in writing handler tests.

Add ContextRoute method. Efficiency fix on Context data

17 Apr 19:08
4a4229d
Compare
Choose a tag to compare

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

16 Apr 18:57
e7c8e18
Compare
Choose a tag to compare

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

11 Apr 08:34
Compare
Choose a tag to compare

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

18 Dec 18:14
Compare
Choose a tag to compare

No code changes. This release just adds support for Go Modules. Thanks @SamWhited for the PR!

Fix doubly-escaped characters when redirecting

13 Feb 07:49
7f53248
Compare
Choose a tag to compare

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+

11 Oct 20:17
Compare
Choose a tag to compare

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.