package http

import "github.com/coreos/etcd/http"

Index

Types

type CORSHandler

type CORSHandler struct {
	Handler http.Handler
	Info    *CORSInfo
}

func (*CORSHandler) ServeHTTP

func (h *CORSHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP adds the correct CORS headers based on the origin and returns immediately with a 200 OK if the method is OPTIONS.

type CORSInfo

type CORSInfo map[string]bool

func NewCORSInfo

func NewCORSInfo(origins []string) (*CORSInfo, error)

func (CORSInfo) OriginAllowed

func (c CORSInfo) OriginAllowed(origin string) bool

OriginAllowed determines whether the server will allow a given CORS origin.

type LowerQueryParamsHandler

type LowerQueryParamsHandler struct {
	Handler http.Handler
}

func NewLowerQueryParamsHandler

func NewLowerQueryParamsHandler(hdlr http.Handler) *LowerQueryParamsHandler

func (*LowerQueryParamsHandler) ServeHTTP

func (h *LowerQueryParamsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

Source Files

cors.go query_params.go

Version
v0.4.7
Published
Feb 10, 2015
Platform
linux/amd64
Imports
4 packages
Last checked
11 minutes ago

Tools for package owners.