urlx

package
v0.17.21 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsEncodedSlash

func ContainsEncodedSlash(path string) bool

ContainsEncodedSlash reports whether path contains a URL-encoded slash sequence, case-insensitive, e.g. %2F or %2f.

func EscapedPath added in v0.17.20

func EscapedPath(value *url.URL) string

EscapedPath returns a valid encoded path while preserving existing percent-encoded octets from URL.RawPath.

It assumes that RawPath originates from URL parsing and represents Path. Unlike url.URL.EscapedPath, an invalid literal byte in RawPath does not cause the complete encoded representation to be discarded.

func NormalizePath

func NormalizePath(path string) string

func PathHasDotSegments

func PathHasDotSegments(path string) bool

func PathUnescape added in v0.17.19

func PathUnescape(value string, opts UnescapeOptions) string

PathUnescape decodes percent-encoded octets according to opts. Malformed percent-encoded sequences are preserved unchanged. Decoding is performed in a single pass.

Types

type UnescapeMode added in v0.17.19

type UnescapeMode uint8
const (
	UnescapeAll UnescapeMode = iota
	UnescapeAllExceptSlash
	UnescapeUnreserved
)

type UnescapeOptions added in v0.17.19

type UnescapeOptions struct {
	Mode UnescapeMode
}

Jump to

Keyboard shortcuts

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