incapsula

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReeseScriptNotFound = errors.New("hyper: reese script not found")
	ErrNotInterruptionPage = errors.New("hyper: not an interruption page")
	ErrInvalidURL          = errors.New("hyper: invalid URL")
)
View Source
var (
	ErrScriptNotFound = errors.New("hyper: utmvc script not found")
)

Functions

func GetUtmvcSubmitPath

func GetUtmvcSubmitPath() string

GetUtmvcSubmitPath generates a UTMVC submit path with a unique random query parameter.

This function constructs a submit path for the UTMVC script by appending a random floating-point number as a query parameter. The random number is used to ensure the uniqueness of the request.

func ParseDynamicReeseScript

func ParseDynamicReeseScript(html io.Reader, urlStr string) (sensorPath string, scriptPath string, err error)

ParseDynamicReeseScript parses the sensor path and script path from the given HTML content.

This function searches the provided HTML for a script element containing a specific pattern and extracts both the sensor path (shortened path) and script path (the full path). It requires that the HTML contains "Pardon Our Interruption" to confirm it's the correct page type. It also takes a URL string, extracts the hostname, and appends it to the sensor path. Returns the sensor path (with hostname) and script path if found, or appropriate errors otherwise.

func ParseUtmvcScriptPath

func ParseUtmvcScriptPath(script io.Reader) (string, error)

ParseUtmvcScriptPath parses the UTMVC script path from the given script content.

This function searches the provided script content for a specific pattern matching the UTMVC script path using a precompiled regular expression. It extracts and returns the first match if found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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