Skip to content

v0.2.0

Choose a tag to compare

@goloop goloop released this 12 Jul 07:59
Run 404/405 through middleware, guard writes and zero-value use

Custom 404 and 405 handlers now dispatch through the router-level middleware
chain, so security headers, CORS and logging added with Use cover error
replies too instead of being bypassed. Middleware may run without a matched
route on this path, where PathValue/Param are empty.

An error-returning handler that already wrote a response and then returns an
error no longer has the error handler write a second, corrupting response: a
tracking writer skips the error handler once anything was written and forwards
Unwrap so http.ResponseController still reaches the underlying Flusher and
Hijacker.

A zero-value Router{} now panics with a clear "use mux.New()" message rather
than a nil dereference, and the joinPattern shorthand is documented: a slashless
token inside a Route prefix is a path fragment, so a host pattern must include
a slash.