Files
traefik-botfilter/util.go
T
2026-01-13 15:23:00 +08:00

18 lines
311 B
Go

package botfilter
import (
"net"
"net/http"
"net/netip"
"net/url"
pathpkg "path"
"strings"
)
func clientIP(r *http.Request, cfg *compiledConfig) netip.Addr {
remote := parseRemoteAddress(r.RemoteAddr)
if cfg.clientIPHeader == "" || !addressInPrefixes(remote, cfg.trustedProxies) {
return remote
}