redirect

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package redirect holds checks shared by the return_to validators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathIsPlain

func PathIsPlain(u *url.URL) bool

PathIsPlain reports whether u's path is the path a browser will request: it has no "." or ".." segments, written plainly or percent-encoded, and does not decode to one starting with "//".

A validator that checks the raw string and then hands it on is not enough on its own: "/.//evil.example" starts with a single slash, but a client that resolves it and rebuilds the URL from its path gets "//evil.example", which a browser reads as another host.

Types

This section is empty.

Jump to

Keyboard shortcuts

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