utils

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIgnoredBlockedURIs = []string{
	"resource://",
	"chromenull://",
	"chrome-extension://",
	"safari-extension://",
	"mxjscall://",
	"webviewprogressproxy://",
	"res://",
	"mx://",
	"safari-resource://",
	"chromeinvoke://",
	"chromeinvokeimmediate://",
	"mbinit://",
	"opera://",
	"ms-appx://",
	"ms-appx-web://",
	"localhost",
	"127.0.0.1",
	"none://",
	"about:blank",
	"android-webview",
	"ms-browser-extension",
	"wvjbscheme://__wvjb_queue_message__",
	"nativebaiduhd://adblock",
	"bdvideo://error",
}

Functions

func GetClientIP

func GetClientIP(r *http.Request) (netip.Addr, error)

func Ternary added in v0.0.15

func Ternary(condition bool, trueValue, falseValue string) string

func TrimEmptyAndComments

func TrimEmptyAndComments(s []string) []string

func TruncateClientIP

func TruncateClientIP(addr netip.Addr) string

func TruncateQueryStringFragment

func TruncateQueryStringFragment(uri string) string

func ValidateOrigin added in v0.0.15

func ValidateOrigin(origin string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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