header

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MPL-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadFramingModifier

func NewBadFramingModifier() martian.RequestModifier

NewBadFramingModifier makes a best effort to fix inconsistencies in the request such as multiple Content-Lengths or the lack of Content-Length and improper Transfer-Encoding. If it is unable to determine a proper resolution it returns an error.

http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-14#section-3.3

func NewForwardedModifier

func NewForwardedModifier() martian.RequestModifier

NewForwardedModifier sets the X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Url headers.

If X-Forwarded-For is already present, the client IP is appended to the existing value. X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Url are preserved if already present.

TODO: Support "Forwarded" header. see: http://tools.ietf.org/html/rfc7239

func NewHopByHopModifier

func NewHopByHopModifier() martian.RequestResponseModifier

NewHopByHopModifier removes Hop-By-Hop headers from requests and responses.

Types

type ViaModifier

type ViaModifier struct {
	// contains filtered or unexported fields
}

ViaModifier is a header modifier that checks for proxy redirect loops.

func NewViaModifier

func NewViaModifier(requestedBy string) *ViaModifier

NewViaModifier returns a new Via modifier.

func NewViaModifierWithBoundary added in v1.4.0

func NewViaModifierWithBoundary(requestedBy, boundary string) *ViaModifier

func (*ViaModifier) ModifyRequest

func (m *ViaModifier) ModifyRequest(req *http.Request) error

ModifyRequest sets the Via header and provides loop-detection. If Via is already present, it will be appended to the existing value. If a loop is detected an error is added to the context and the request round trip is skipped.

http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-14#section-9.9

Jump to

Keyboard shortcuts

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