schemehost

package
v3.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package schemehost compares the scheme and host of two URLs for same-origin checks. It is shared by the CSRF middleware (Origin/Referer validation) and the core redirect logic (open-redirect prevention).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(schemeA, hostA, schemeB, hostB string) bool

Match reports whether (schemeA, hostA) and (schemeB, hostB) denote the same origin. Scheme comparison is case-insensitive and default ports (http:80, https:443) are normalized so "example.com" and "example.com:443" match.

Types

This section is empty.

Jump to

Keyboard shortcuts

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