parseurl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package parseurl parses the URL of an incoming HTTP request into its components.

It is a port of the npm package "parseurl". The reference implementation memoizes the parsed URL on the request object; this port simply parses the request's RequestURI (falling back to the request's URL field) on each call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OriginalURL

func OriginalURL(req *http.Request) *url.URL

OriginalURL parses the request's original URL. Like Parse, it uses req.RequestURI as the source of the original, unmodified request target.

func Parse

func Parse(req *http.Request) *url.URL

Parse parses the request's effective URL, using req.RequestURI and falling back to req.URL when RequestURI is empty or cannot be parsed. It returns nil when req is nil.

func ParseString

func ParseString(rawurl string) (*url.URL, error)

ParseString parses a raw URL string into a *url.URL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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