headerfilter

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxHeaderValue = 1024

Maximum header value size before we return an instant negative match. They shouldn't go beyond this size in most cases anywho.

Variables

View Source
var ErrLargeHeaderValue = errors.New("header value too large")

ErrLargeHeaderValue is returned on attempting to match on a value > MaxHeaderValue.

Functions

This section is empty.

Types

type Filters

type Filters []headerfilter

Filters represents a set of http.Header regular expression filters built-in statistic tracking.

func (*Filters) Append

func (fs *Filters) Append(key string, expr string) error

Append will add new header filter expression under given header key.

func (Filters) InverseMatch

func (fs Filters) InverseMatch(h http.Header) (string, string, error)

InverseMatch returns whether any values in http header do NOT match any of the receiving filter regular expressions. This returns the matched header key, and matching regexp.

func (Filters) RegularMatch

func (fs Filters) RegularMatch(h http.Header) (string, string, error)

RegularMatch returns whether any values in http header matches any of the receiving filter regular expressions. This returns the matched header key, and matching regexp.

Jump to

Keyboard shortcuts

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