forwarded

package
v0.15.41 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package forwarded implements a set of custom predicate to match routes based on the standardized Forwarded header.

https://datatracker.ietf.org/doc/html/rfc7239 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded

Examples:

// only match requests to "example.com"
example1: ForwardedHost("example.com") -> "http://example.org";

// only match requests to http
example2: ForwardedProtocol("http") -> "http://example.org";

// only match requests to https
example3: ForwardedProtocol("https") -> "http://example.org";

Index

Constants

View Source
const (
	// Deprecated, use predicates.ForwardedHostName instead
	NameHost = predicates.ForwardedHostName
	// Deprecated, use predicates.ForwardedProtocolName instead
	NameProto = predicates.ForwardedProtocolName
)

Variables

This section is empty.

Functions

func NewForwardedHost

func NewForwardedHost() routing.PredicateSpec

func NewForwardedProto

func NewForwardedProto() routing.PredicateSpec

Types

This section is empty.

Jump to

Keyboard shortcuts

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