Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mpolden/echoip
/ ipFromForwardedForHeader
Function
ipFromForwardedForHeader
http/http.go:70–76 ·
view source on GitHub ↗
(v string)
Source
from the content-addressed store, hash-verified
68
}
69
70
func
ipFromForwardedForHeader(v string) string {
71
before, _, ok := strings.Cut(v,
","
)
72
if
!ok {
73
return
v
74
}
75
return
before
76
}
77
78
// ipFromRequest detects the IP address for this transaction.
79
//
Callers
1
ipFromRequest
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected