headers

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRemoteHostInfo added in v0.4.0

func GetRemoteHostInfo(r *http.Request) string

GetRemoteHostInfo extracts the remote host information from the request, inspecting common proxy headers like CF-Connecting-IP, X-Real-IP, and X-Forwarded-For. It returns a formatted string with the remote address and user agent.

func SliceToMap

func SliceToMap(headerStrings []string) (map[string]string, error)

Slice2Map takes a slice of header strings in "key:value" format and returns a map. Returns an error if any header has an invalid format.

func ToMap

func ToMap(headers http.Header, dropHeaders []string, privMode bool) map[string]string

ToMap converts an http.Header to a "key:value" map. It takes a list of headers to drop and a privacy mode flag to exclude headers that may reveal sensitive information of the internal network. Note that enabling debug logging will log all dropped headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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