Releases: hawry/middlewares
Releases · hawry/middlewares
v0.1.4: Error Handler
Changes
New features
- Added a new handler called Error Handler that will printout a standard error page if the returned status code is in the 400 or 500 series. Any calls to Write() after a 400/500 code is written to the ResponseWriter will be used as the message body in the error page.
Fixes
- Removed unused source file (fp_handler.go)
Documentation
Documentation available at: https://godoc.org/github.com/hawry/middlewares
v0.1.3: Bugfixes
Changes
Fixes
- A typo/lack of sleep made the Authorization header into Authentication which is fixed in this release, so the token handler can be used now.
- Warning outputs from the token handler if no tokens can be found now prepends a newline to reduce log cluttering
Documentation
Can be found at GoDoc: https://godoc.org/github.com/Hawry/middlewares
v0.1.2: Middlewares
Middlewares
Package middlewares aims to create a set of commonly used middleware http.Handlers for use with the default http package. All handlers only takes a http.Handler as an argument, and returns only http.Handler, to more easily be chained with handler chain libraries (e.g. https://github.com/justinas/alice)
Handlers
- CORS Handler that appends CORS headers depending on the request, and your settings
- Token handler that extracts any bearer token from a request, if found
- Basic authorization handler that extracts username and password from a request that contains a Basic authorization header
- Logging handler that writes a log in Apache Combined Logging format to the output of your choosing (see documentation for an example of how to log both to console and file at the same time)
Documentation
Can be found at GoDoc: https://godoc.org/github.com/Hawry/middlewares