fiberx

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP(ctx fiber.Ctx) string

GetIP returns the client IP resolved by Fiber. When the application configures trusted proxies (vef.app.trusted_proxies), this honors X-Forwarded-For from those proxies; otherwise it is the direct connection peer. A raw, client-supplied X-Forwarded-For is never trusted.

The result is always a copy. Behind a trusted proxy Fiber returns a slice of the proxy header, and the framework builds Fiber with Immutable off, so that slice is a view into the pooled request buffer: the bytes belong to whatever request reuses the buffer once the handler returns. Copying here rather than at each retention point is what makes every caller safe by construction — a rate-limit key that is discarded within the request and an audit record that outlives it read the same accessor, and nothing about the second call site looks more dangerous than the first.

func IsJSON

func IsJSON(ctx fiber.Ctx) bool

IsJSON checks if the request content type is JSON.

func IsMultipart

func IsMultipart(ctx fiber.Ctx) bool

IsMultipart checks if the request content type is multipart/form-data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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