headers

package
v2.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 5 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderOps

type HeaderOps struct {
	Add    http.Header `json:"add,omitempty"`
	Set    http.Header `json:"set,omitempty"`
	Delete []string    `json:"delete,omitempty"`
}

HeaderOps defines some operations to perform on HTTP headers.

type Headers

type Headers struct {
	Request  *HeaderOps     `json:"request,omitempty"`
	Response *RespHeaderOps `json:"response,omitempty"`
}

Headers is a middleware which can mutate HTTP headers.

func (Headers) CaddyModule

func (Headers) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (Headers) ServeHTTP

func (h Headers) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

type RespHeaderOps

type RespHeaderOps struct {
	*HeaderOps
	Require  *caddyhttp.ResponseMatcher `json:"require,omitempty"`
	Deferred bool                       `json:"deferred,omitempty"`
}

RespHeaderOps is like HeaderOps, but optionally deferred until response time.

Jump to

Keyboard shortcuts

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