Documentation
¶
Index ¶
- func DecodeHexPair(hi, lo byte) (byte, bool)
- func EqualASCIIIgnoreCase(s, t uint8) bool
- func EqualStringsASCIIIgnoreCase(s1, s2 string) bool
- func EscapePath(path string) string
- func IsRoutableRaw(b byte) bool
- func IsUnreserved(b byte) bool
- func NormalizeRawPath(raw, path string) (norm string, wellFormed, consistent bool)
- func ToLowerASCII(b byte) byte
- func UpperHex(c byte) byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeHexPair ¶ added in v0.31.0
DecodeHexPair decodes two ASCII hexadecimal digits into a byte. It returns false if either character is not a hexadecimal digit.
func EqualASCIIIgnoreCase ¶
EqualASCIIIgnoreCase performs case-insensitive comparison of two ASCII bytes. Only supports ASCII letters (A-Z, a-z), digits (0-9), hyphen (-) and underscore (_). Used for hostname matching where registered routes follow LDH standard.
func EqualStringsASCIIIgnoreCase ¶
EqualStringsASCIIIgnoreCase performs case-insensitive comparison of two strings containing ASCII characters. Only supports ASCII letters (A-Z, a-z), digits (0-9), hyphen (-) and underscore (_). Used for hostname matching where registered routes follow LDH standard.
func EscapePath ¶ added in v0.31.0
EscapePath returns the default encoding of a decoded URL path. It mirrors net/url.URL.EscapedPath for an unset RawPath, including the Path == "*" special case.
func IsRoutableRaw ¶ added in v0.31.0
IsRoutableRaw reports whether b can appear unescaped in a routing path, i.e. whether NormalizeRawPath can emit it unescaped.
func IsUnreserved ¶ added in v0.31.0
IsUnreserved reports whether b is an RFC 3986 unreserved character: ALPHA / DIGIT / "-" / "." / "_" / "~". Unreserved characters are the only ones that can be safely percent-decoded without changing the meaning of a URI.
func NormalizeRawPath ¶ added in v0.31.0
NormalizeRawPath returns the canonical routing form of an escaped path. Unreserved escapes are decoded, hex is uppercased, bytes that cannot appear unescaped (see IsRoutableRaw) are percent-encoded in place and the path is kept as-is from the first malformed escape. It reports whether raw is well-formed and whether it is an encoding of the decoded path. When consistent is false, the routing path must be derived from path instead.
func ToLowerASCII ¶
ToLowerASCII converts an ASCII uppercase letter (A-Z) to lowercase (a-z). All other bytes are returned unchanged. Does not validate ASCII range;
Types ¶
This section is empty.