util

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllowedDomain

func IsAllowedDomain(inputURL string, allowedDomains []string) error

IsAllowedDomain checks if the given URL's domain is in the allowed list.

func SanitizeLog

func SanitizeLog(s string) string

SanitizeLog removes or escapes control characters like CRLF to prevent log injection.

func ValidatePath

func ValidatePath(baseDir, inputPath string) (string, error)

ValidatePath ensures that the given path is within the base directory. It returns the cleaned absolute path or an error if the path escapes the base.

Types

This section is empty.

Jump to

Keyboard shortcuts

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