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
()
| 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. |
| 527 | func (r *DefaultReq) Hostname() string { |
| 528 | addr, _ := parseAddr(r.Host()) |
| 529 | |
| 530 | return addr |
| 531 | } |
| 532 | |
| 533 | // Port returns the remote port of the request. |
| 534 | func (r *DefaultReq) Port() string { |
no test coverage detected