normalize

package
v0.0.0-...-d51039f Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package normalize provides URL normalization.

https://en.wikipedia.org/wiki/URI_normalization

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RawURL

func RawURL(rawurl string) (string, error)

RawURL normalizes the given raw URL.

  • Uppercase percent-encoded triplets.
  • Lowercase the scheme and hostname.
  • Lowercase the username.
  • Decode percent-encoded triplets.
  • Removes dot segments.
  • Converts an empty path to `/`.
  • Removes the default port (:80, :443).
  • Removes `?` when query is empty.
  • Remove the fragment.

func URL

func URL(u *url.URL) *url.URL

URL normalizes a parsed URL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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