MCPcopy
hub / github.com/gofiber/fiber / Hostname

Method Hostname

req.go:527–531  ·  view source on GitHub ↗

Hostname contains the hostname derived from the X-Forwarded-Host or Host HTTP header using the c.Host() method. Returned value is only valid within the handler. Do not store any references. Example: URL: https://example.com:8080 -> Hostname: example.com Make copies or use the Immutable setting inste

()

Source from the content-addressed store, hash-verified

525// Make copies or use the Immutable setting instead.
526// Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy.
527func (r *DefaultReq) Hostname() string {
528 addr, _ := parseAddr(r.Host())
529
530 return addr
531}
532
533// Port returns the remote port of the request.
534func (r *DefaultReq) Port() string {

Callers 1

SubdomainsMethod · 0.95

Calls 2

HostMethod · 0.95
parseAddrFunction · 0.85

Tested by

no test coverage detected