Skip to content

Tags: hawry/middlewares

Tags

v0.1.4

Toggle v0.1.4's commit message
add error handler

ErrorHandler will printout a standard error page if the returned status
code is in the 400 or 500 range. Calls to Write() will be used as a
error message in the returned page.

v0.1.3

Toggle v0.1.3's commit message
Bugfixes

- Rename the non-existing 'Authentication' header for 'Authorization' which actually exists and should be used

v0.1.2

Toggle v0.1.2's commit message
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

v0.1.1

Toggle v0.1.1's commit message
Pre-release of package