csprecon

package
v0.0.0-...-f98508c Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TLSHandshakeTimeout = 10
	KeepAlive           = 30
	DomainRegex         = `(?m)(?i)(?:\*\.|)([a-z][a-z_0-9.-]+\.[a-z]+)`
	MinURLLength        = 4
)

Variables

This section is empty.

Functions

func CheckCSP

func CheckCSP(url, ua string, rCSP *regexp.Regexp, client *http.Client) ([]string, error)

CheckCSP returns the list of domains parsed from a URL found in CSP.

func CompileRegex

func CompileRegex(regex string) *regexp.Regexp

func ParseBodyCSP

func ParseBodyCSP(body io.Reader, rCSP *regexp.Regexp) []string

ParseBodyCSP returns the list of domains parsed from the CSP found in the meta tag of the input HTML body.

func ParseCSP

func ParseCSP(input string, r *regexp.Regexp) []string

ParseCSP returns the list of domains parsed from a raw CSP (string).

func PrepareURL

func PrepareURL(inputURL string) (string, error)

PrepareURL takes as input a string and prepares the input URL in order to get the favicon icon.

Types

type Runner

type Runner struct {
	Input     chan string
	Output    chan string
	Result    output.Result
	UserAgent string
	InWg      *sync.WaitGroup
	OutWg     *sync.WaitGroup
	Options   input.Options
	OutMutex  *sync.Mutex
}

func New

func New(options *input.Options) Runner

func (*Runner) Run

func (r *Runner) Run()

Jump to

Keyboard shortcuts

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