Documentation ¶
Overview ¶
Utility wrappers for HTTP handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cache ¶
Store cacheable resources on disk. Naive (and non-conforming) implementation of a HTTP cache. Note that this is really not transparent caching:
- Headers are not cached
- As a consequence, encoded data (gzip etc) is served from cache as raw data
- Upstream status code is completely ignored
- Caching directives from client are ignored
- HTTP caching directives from upstream are ignored
- Non-standard upstream "X-Cache" header is used to determine cacheability
- Cache hits are served as raw files, introducing some illegal headers
- and probably more...
All of that notwithstanding, this is a proof of concept worth exploring.
func Mimetype ¶
Best-effort guessing of mime-type based on extension of request path. Does not override content-type if already set.
func XFrameOptions ¶
Disallow resources from being included in (i)frames on other sites unless specified otherwise. This is done through the X-Frame-Options header. If a handler does not explicitly set this header, it is set to SAMEORIGIN.
http://tools.ietf.org/html/draft-ietf-websec-x-frame-options-01
Types ¶
This section is empty.