urlutil

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualURLs

func EqualURLs(first, second *url.URL) bool

EqualURLs returns true if the two *url.URL values are effectively equal taking into consideration web normalization.

func HasDomainSuffix

func HasDomainSuffix(domain, domainSuffix string) bool

HasDomainSuffix returns true if the URI hostname is equal to the domain or if it has a suffix of the domain prefixed with a period.

func HasURIDomainSuffix

func HasURIDomainSuffix(uri *url.URL, domainSuffix string) bool

HasURIDomainSuffix returns true if the URI hostname is equal to the domain suffix or if it has a suffix of the domain suffix prefixed with a period.

func IsURISafeRedirection

func IsURISafeRedirection(uri *url.URL, domain string) bool

IsURISafeRedirection returns true if the URI passes the IsURISecure and HasURIDomainSuffix, i.e. if the scheme is secure and the given URI has a hostname that is either exactly equal to the given domain or if it has a suffix of the domain prefixed with a period.

func IsURISecure

func IsURISecure(uri *url.URL) bool

IsURISecure returns true if the URI has a secure schemes (https or wss).

func URLPathFullClean

func URLPathFullClean(u *url.URL) (output string)

URLPathFullClean returns a URL path with the query parameters appended (full path) with the path portion parsed through path.Clean given a *url.URL.

func ValidateURL

func ValidateURL(u *url.URL) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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