go.trustforward: github.com/daaku/go.trustforward Index | Files

package trustforward

import "github.com/daaku/go.trustforward"

Package trustforward provides wrappers that trust X-Forwarded-* headers when looking up certain values. Using this package to access the values allows you to control at runtime (via a flag) whether the values will be trusted.


Package Files


type Forwarded Uses

type Forwarded struct {
    X          bool
    CloudFlare bool

Forwarded enables or disables X-Forwarded or CloudFlare headers.

func (*Forwarded) Host Uses

func (f *Forwarded) Host(r *http.Request) string

Get the Host.

func (*Forwarded) Remote Uses

func (f *Forwarded) Remote(r *http.Request) string

Get the Remote Address.

func (*Forwarded) Scheme Uses

func (f *Forwarded) Scheme(r *http.Request) string

Get the Scheme.

Package trustforward imports 1 packages (graph) and is imported by 10 packages. Updated 2016-07-21. Refresh now. Tools for package owners.