referrerpolicy

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NoReferrer No referrer information is sent with requests. Provides maximum privacy protection by
	// completely hiding the source page URL from the destination.
	NoReferrer = ReferrerPolicy("no-referrer")

	// NoReferrerWhenDowngrade No referrer when downgrading from HTTPS to HTTP (default browser behavior). Protects against
	// leaking secure page URLs to insecure destinations.
	NoReferrerWhenDowngrade = ReferrerPolicy("no-referrer-when-downgrade")

	// Origin Only the origin (protocol, domain, port) is sent as referrer information. Provides basic
	// privacy while allowing destination to know the source domain.
	Origin = ReferrerPolicy("origin")

	// OriginWhenCrossOrigin Full URL for same-origin requests, origin only for cross-origin requests. Balances
	// functionality with privacy for different request types.
	OriginWhenCrossOrigin = ReferrerPolicy("origin-when-cross-origin")

	// SameOrigin Referrer information sent for same-origin requests only, none for cross-origin. Keeps
	// referrer data within the same domain for privacy.
	SameOrigin = ReferrerPolicy("same-origin")

	// StrictOrigin Origin only, no referrer when downgrading from HTTPS to HTTP. More secure version of
	// origin policy with downgrade protection.
	StrictOrigin = ReferrerPolicy("strict-origin")

	// StrictOriginWhenCrossOrigin Full URL for same-origin, origin for cross-origin, no referrer when downgrading. Most
	// comprehensive policy balancing security and functionality.
	StrictOriginWhenCrossOrigin = ReferrerPolicy("strict-origin-when-cross-origin")

	// UnsafeUrl Always send full URL as referrer. Least secure option that may leak sensitive information
	// including query parameters and path details.
	UnsafeUrl = ReferrerPolicy("unsafe-url")
)

Variables for ReferrerPolicy values

Functions

This section is empty.

Types

type ReferrerPolicy

type ReferrerPolicy []byte

ReferrerPolicy Controls how much referrer information is sent when fetching resources or navigating to links. Helps protect user privacy by limiting information shared about the referring page.

func Custom

func Custom(value string) ReferrerPolicy

Custom allows setting a custom ReferrerPolicy value for edge cases or future specifications. Use this when the predefined constants don't cover your specific use case.

Jump to

Keyboard shortcuts

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