Documentation
¶
Overview ¶
Middleware for the net/http library
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GZip ¶
GZip returns a handler which gzip's the response for all requests which accept that encoding.
func Inject ¶
Inject appends JavaScript to the body of all HTML responses. It buffers all responses in memory (so use it selectively). It prints all parsing errors using the log package's Print function rather than returning 500s.
func ProxyRedirect ¶
ProxyRedirect joins basePath to the location header of all redirects generated the by handler. It also changes the scheme as provided.
p := httputil.NewSingleHostReverseProxy(u) // force redirects to use https and prepend "/foo/bar" to all paths h := middleware.ProxyRedirect("https", "/foo/bar", p)
TODO: Add refresh header handling
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.