referrer

package
v6.15.0-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Blacklist = []string{
	" and ",
	" or ",
	" xor ",
	"for (",
	"for(",
	"from (",
	"from(",
	"pg_sleep",
	"select (",
	"select(",
	"sleep (",
	"sleep(",
	"sysdate",
	"while (",
	"while(",
}

Blacklist is a list of referrer keywords to ignore.

View Source
var QueryParams = []struct {
	param        string
	preferHeader bool
}{
	{"ref", false},
	{"referer", false},
	{"referrer", false},
	{"source", true},
	{"utm_source", true},
}

QueryParams is a list of query parameters to set the referrer.

Functions

func Get

func Get(r *http.Request, ref, requestHostname string) (string, string, string)

Get returns the referrer for given request.

func Ignore

func Ignore(r *http.Request) bool

Ignore returns whether a referrer should be ignored or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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