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 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 is allowed 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 and bytes that must be escaped in a path are percent-encoded in place. wellFormed reports that no such byte was found. In that case norm differs from raw only by hex case or by a decoded unreserved escape, and RFC 3986 guarantees that both forms identify the same resource. A transformation that breaks this guarantee must report wellFormed false. It returns "" when raw contains a malformed escape or is not an encoding of path. The routing form must then be derived from path.
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.