sbff

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HeaderName = "sb-forwarded-for"

HeaderName is the Sb-Forwarded-For header name. It is all lowercase here as HTTP header names are not case-sensitive.

Variables

View Source
var (
	ErrHeaderNotFound = errors.New("Sb-Forwarded-For header not found")
	ErrHeaderInvalid  = errors.New("invalid Sb-Forwarded-For header value")
)

Functions

func GetIPAddress

func GetIPAddress(r *http.Request) (addr string, found bool)

GetIPAddress returns the value of the IP address in Sb-Forwarded-For as defined by SBForwardedForMiddleware. If no value is present in the request context, this function will return ("", false).

func Middleware

func Middleware(cfg *conf.SecurityConfiguration, errCallback func(*http.Request, error)) func(http.Handler) http.Handler

Middleware returns a middleware function that parses the Sb-Forwarded-For header and adds the leftmost header value to the request context if GOTRUE_SECURITY_SB_FORWARDED_FOR_ENABLED is true and the value is a valid IP address.

Types

This section is empty.

Jump to

Keyboard shortcuts

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