godspeed

package module
v0.0.0-...-9920d2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2013 License: MIT Imports: 11 Imported by: 0

README

Explanation for usage of this library can be extracted from the source using
godoc: <http://godoc.org/github.com/hraban/godspeed>.

The licensing terms are described in the file LICENSE.

Documentation

Overview

Utility wrappers for HTTP handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache(h http.Handler) http.Handler

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 Compress

func Compress(h http.Handler) http.Handler

Compress response if possible

func Mimetype

func Mimetype(h http.Handler) http.Handler

Best-effort guessing of mime-type based on extension of request path. Does not override content-type if already set.

func XFrameOptions

func XFrameOptions(h http.Handler) http.Handler

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

func XXSSProtection

func XXSSProtection(h http.Handler) http.Handler

Turn on MSIE8 XSS protection filter.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL