1# Changelog
2
3## v4.1.2 (2020-06-02)
4
5- fix that handles MethodNotAllowed with path variables, thank you @caseyhadden for your contribution
6- fix to replace nested wildcards correctly in RoutePattern, thank you @@unmultimedio for your contribution
7- History of changes: see https://github.com/go-chi/chi/compare/v4.1.1...v4.1.2
8
9
10## v4.1.1 (2020-04-16)
11
12- fix for issue https://github.com/go-chi/chi/issues/411 which allows for overlapping regexp
13 route to the correct handler through a recursive tree search, thanks to @Jahaja for the PR/fix!
14- new middleware.RouteHeaders as a simple router for request headers with wildcard support
15- History of changes: see https://github.com/go-chi/chi/compare/v4.1.0...v4.1.1
16
17
18## v4.1.0 (2020-04-1)
19
20- middleware.LogEntry: Write method on interface now passes the response header
21 and an extra interface type useful for custom logger implementations.
22- middleware.WrapResponseWriter: minor fix
23- middleware.Recoverer: a bit prettier
24- History of changes: see https://github.com/go-chi/chi/compare/v4.0.4...v4.1.0
25
26
27## v4.0.4 (2020-03-24)
28
29- middleware.Recoverer: new pretty stack trace printing (https://github.com/go-chi/chi/pull/496)
30- a few minor improvements and fixes
31- History of changes: see https://github.com/go-chi/chi/compare/v4.0.3...v4.0.4
32
33
34## v4.0.3 (2020-01-09)
35
36- core: fix regexp routing to include default value when param is not matched
37- middleware: rewrite of middleware.Compress
38- middleware: suppress http.ErrAbortHandler in middleware.Recoverer
39- History of changes: see https://github.com/go-chi/chi/compare/v4.0.2...v4.0.3
40
41
42## v4.0.2 (2019-02-26)
43
44- Minor fixes
45- History of changes: see https://github.com/go-chi/chi/compare/v4.0.1...v4.0.2
46
47
48## v4.0.1 (2019-01-21)
49
50- Fixes issue with compress middleware: #382 #385
51- History of changes: see https://github.com/go-chi/chi/compare/v4.0.0...v4.0.1
52
53
54## v4.0.0 (2019-01-10)
55
56- chi v4 requires Go 1.10.3+ (or Go 1.9.7+) - we have deprecated support for Go 1.7 and 1.8
57- router: respond with 404 on router with no routes (#362)
58- router: additional check to ensure wildcard is at the end of a url pattern (#333)
59- middleware: deprecate use of http.CloseNotifier (#347)
60- middleware: fix RedirectSlashes to include query params on redirect (#334)
61- History of changes: see https://github.com/go-chi/chi/compare/v3.3.4...v4.0.0
62
63
64## v3.3.4 (2019-01-07)
65
66- Minor middleware improvements. No changes to core library/router. Moving v3 into its
67- own branch as a version of chi for Go 1.7, 1.8, 1.9, 1.10, 1.11
68- History of changes: see https://github.com/go-chi/chi/compare/v3.3.3...v3.3.4
69
70
71## v3.3.3 (2018-08-27)
72
73- Minor release
74- See https://github.com/go-chi/chi/compare/v3.3.2...v3.3.3
75
76
77## v3.3.2 (2017-12-22)
78
79- Support to route trailing slashes on mounted sub-routers (#281)
80- middleware: new `ContentCharset` to check matching charsets. Thank you
81 @csucu for your community contribution!
82
83
84## v3.3.1 (2017-11-20)
85
86- middleware: new `AllowContentType` handler for explicit whitelist of accepted request Content-Types
87- middleware: new `SetHeader` handler for short-hand middleware to set a response header key/value
88- Minor bug fixes
89
90
91## v3.3.0 (2017-10-10)
92
93- New chi.RegisterMethod(method) to add support for custom HTTP methods, see _examples/custom-method for usage
94- Deprecated LINK and UNLINK methods from the default list, please use `chi.RegisterMethod("LINK")` and `chi.RegisterMethod("UNLINK")` in an `init()` function
95
96
97## v3.2.1 (2017-08-31)
98
99- Add new `Match(rctx *Context, method, path string) bool` method to `Routes` interface
100 and `Mux`. Match searches the mux's routing tree for a handler that matches the method/path
101- Add new `RouteMethod` to `*Context`
102- Add new `Routes` pointer to `*Context`
103- Add new `middleware.GetHead` to route missing HEAD requests to GET handler
104- Updated benchmarks (see README)
105
106
107## v3.1.5 (2017-08-02)
108
109- Setup golint and go vet for the project
110- As per golint, we've redefined `func ServerBaseContext(h http.Handler, baseCtx context.Context) http.Handler`
111 to `func ServerBaseContext(baseCtx context.Context, h http.Handler) http.Handler`
112
113
114## v3.1.0 (2017-07-10)
115
116- Fix a few minor issues after v3 release
117- Move `docgen` sub-pkg to https://github.com/go-chi/docgen
118- Move `render` sub-pkg to https://github.com/go-chi/render
119- Add new `URLFormat` handler to chi/middleware sub-pkg to make working with url mime
120 suffixes easier, ie. parsing `/articles/1.json` and `/articles/1.xml`. See comments in
121 https://github.com/go-chi/chi/blob/master/middleware/url_format.go for example usage.
122
123
124## v3.0.0 (2017-06-21)
125
126- Major update to chi library with many exciting updates, but also some *breaking changes*
127- URL parameter syntax changed from `/:id` to `/{id}` for even more flexible routing, such as
128 `/articles/{month}-{day}-{year}-{slug}`, `/articles/{id}`, and `/articles/{id}.{ext}` on the
129 same router
130- Support for regexp for routing patterns, in the form of `/{paramKey:regExp}` for example:
131 `r.Get("/articles/{name:[a-z]+}", h)` and `chi.URLParam(r, "name")`
132- Add `Method` and `MethodFunc` to `chi.Router` to allow routing definitions such as
133 `r.Method("GET", "/", h)` which provides a cleaner interface for custom handlers like
134 in `_examples/custom-handler`
135- Deprecating `mux#FileServer` helper function. Instead, we encourage users to create their
136 own using file handler with the stdlib, see `_examples/fileserver` for an example
137- Add support for LINK/UNLINK http methods via `r.Method()` and `r.MethodFunc()`
138- Moved the chi project to its own organization, to allow chi-related community packages to
139 be easily discovered and supported, at: https://github.com/go-chi
140- *NOTE:* please update your import paths to `"github.com/go-chi/chi"`
141- *NOTE:* chi v2 is still available at https://github.com/go-chi/chi/tree/v2
142
143
144## v2.1.0 (2017-03-30)
145
146- Minor improvements and update to the chi core library
147- Introduced a brand new `chi/render` sub-package to complete the story of building
148 APIs to offer a pattern for managing well-defined request / response payloads. Please
149 check out the updated `_examples/rest` example for how it works.
150- Added `MethodNotAllowed(h http.HandlerFunc)` to chi.Router interface
151
152
153## v2.0.0 (2017-01-06)
154
155- After many months of v2 being in an RC state with many companies and users running it in
156 production, the inclusion of some improvements to the middlewares, we are very pleased to
157 announce v2.0.0 of chi.
158
159
160## v2.0.0-rc1 (2016-07-26)
161
162- Huge update! chi v2 is a large refactor targetting Go 1.7+. As of Go 1.7, the popular
163 community `"net/context"` package has been included in the standard library as `"context"` and
164 utilized by `"net/http"` and `http.Request` to managing deadlines, cancelation signals and other
165 request-scoped values. We're very excited about the new context addition and are proud to
166 introduce chi v2, a minimal and powerful routing package for building large HTTP services,
167 with zero external dependencies. Chi focuses on idiomatic design and encourages the use of
168 stdlib HTTP handlers and middlwares.
169- chi v2 deprecates its `chi.Handler` interface and requires `http.Handler` or `http.HandlerFunc`
170- chi v2 stores URL routing parameters and patterns in the standard request context: `r.Context()`
171- chi v2 lower-level routing context is accessible by `chi.RouteContext(r.Context()) *chi.Context`,
172 which provides direct access to URL routing parameters, the routing path and the matching
173 routing patterns.
174- Users upgrading from chi v1 to v2, need to:
175 1. Update the old chi.Handler signature, `func(ctx context.Context, w http.ResponseWriter, r *http.Request)` to
176 the standard http.Handler: `func(w http.ResponseWriter, r *http.Request)`
177 2. Use `chi.URLParam(r *http.Request, paramKey string) string`
178 or `URLParamFromCtx(ctx context.Context, paramKey string) string` to access a url parameter value
179
180
181## v1.0.0 (2016-07-01)
182
183- Released chi v1 stable https://github.com/go-chi/chi/tree/v1.0.0 for Go 1.6 and older.
184
185
186## v0.9.0 (2016-03-31)
187
188- Reuse context objects via sync.Pool for zero-allocation routing [#33](https://github.com/go-chi/chi/pull/33)
189- BREAKING NOTE: due to subtle API changes, previously `chi.URLParams(ctx)["id"]` used to access url parameters
190 has changed to: `chi.URLParam(ctx, "id")`
View as plain text