whitelisting

package
v0.0.0-...-50e84b0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinHeaders

func JoinHeaders(message []byte, headers []byte) []byte

JoinHeaders adds headers to the original message, if their field name is not already included.

Types

type Whitelist

type Whitelist []WhitelistItem

func (*Whitelist) Apply

func (wl *Whitelist) Apply(data []byte) ([]byte, []byte, bool)

Apply modifies the request data, so only whitelisted headers are preserved. It is assumed that the first line is the request line and is therefore ignored. The first byte array returned is the request line and all whitelisted headers. The second array contains the headers that are not whitelisted.

func (*Whitelist) Load

func (wl *Whitelist) Load(file string) error

Load reads the whitelist from an according JSON file.

type WhitelistItem

type WhitelistItem struct {
	Key string // header key
	Val string // value as regex
}

Jump to

Keyboard shortcuts

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