Documentation
¶
Index ¶
- Constants
- func IsValidHeaderChar(r rune) bool
- func ValidateCookie(cookie *http.Cookie) error
- func ValidateCookieName(name string) error
- func ValidateCookieValue(value string) error
- func ValidateCredential(cred string, maxLen int, checkColon bool, credType string) error
- func ValidateFieldName(name string, fieldType string) error
- func ValidateHeaderKeyValue(key, value string) error
- func ValidateInputString(input string, maxLen int, name string, additionalChecks func(rune) error) error
- func ValidateQueryKey(key string) error
- func ValidateToken(token string) error
Constants ¶
const ( MaxCredLen = 255 // Maximum credential length (username/password) MaxTokenLen = 2048 // Maximum bearer token length MaxKeyLen = 256 // Maximum query parameter key length MaxValueLen = 8192 // Maximum query parameter value length MaxFilenameLen = 256 // Maximum filename length for uploads MaxCookieNameLen = 256 MaxCookieValueLen = 4096 MaxCookieDomainLen = 255 MaxCookiePathLen = 1024 MaxHeaderKeyLen = 256 MaxHeaderValueLen = 8192 )
Common validation constants
Variables ¶
This section is empty.
Functions ¶
func IsValidHeaderChar ¶ added in v1.3.6
IsValidHeaderChar checks if a character is valid in HTTP header names.
func ValidateCookie ¶ added in v1.3.7
ValidateCookie performs comprehensive validation of an HTTP cookie including name, value, domain, and path attributes.
func ValidateCookieName ¶
ValidateCookieName validates HTTP cookie names.
func ValidateCookieValue ¶
ValidateCookieValue validates HTTP cookie values.
func ValidateCredential ¶
ValidateCredential validates credentials for Basic Auth.
func ValidateFieldName ¶
ValidateFieldName validates form field names and filenames.
func ValidateHeaderKeyValue ¶
ValidateHeaderKeyValue validates HTTP header keys and values.
func ValidateInputString ¶
func ValidateInputString(input string, maxLen int, name string, additionalChecks func(rune) error) error
ValidateInputString performs common string validation to prevent injection attacks.
func ValidateQueryKey ¶
ValidateQueryKey validates query parameter keys.
func ValidateToken ¶
ValidateToken validates bearer tokens according to RFC 6750.
Types ¶
This section is empty.