httputil

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseURL

func GetBaseURL(r *http.Request, fallbackURL string) string

GetBaseURL extracts the base URL from request headers (for nginx proxy) or falls back to configured URL It checks headers in the following order: 1. X-Forwarded-Host with protocol from proxy headers (X-Forwarded-Proto, X-Forwarded-Scheme, X-Forwarded-Ssl, Forwarded) 2. X-Forwarded-Host alone (assumes https if protocol not detected) 3. Host header with protocol from proxy headers (X-Forwarded-Proto, X-Forwarded-Scheme, X-Forwarded-Ssl, Forwarded) 4. Host header with scheme based on TLS connection state 5. Falls back to the provided fallbackURL

Types

This section is empty.

Jump to

Keyboard shortcuts

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