mirror of
https://github.com/librespeed/speedtest.git
synced 2026-05-14 00:36:39 +00:00
* fix: return client IPv6 address via cloudflared The cloudflared reverse proxy populates the X-Forwarded-For header for origin IPv4 addresses, however origin IPv6 addresses are added in a different header: Cf-Connecting-Ipv6. This updates the getIP.php mechanism to retrieve the value of this header and to prefer it over other client IP headers (in both cases only if the Cf-Connecting-Ipv6 header exists and is not empty). * fix: Validate and normalise IP addresses from request headers getClientIp() used HTTP_CF_CONNECTING_IPV6 and other headers verbatim, allowing malformed values to reach ISP lookups and the offline DB. Add normalizeCandidateIp() helper that trims whitespace, extracts the first comma-separated token, and validates via filter_var(). Require FILTER_FLAG_IPV6 for the CF header and fall through to the next source on failure. Written with assistance from OpenCode using Claude Opus 4.6. |
||
|---|---|---|
| .. | ||
| country_asn.mmdb | ||
| empty.php | ||
| garbage.php | ||
| geoip2.phar | ||
| getIP.php | ||
| getIP_ipInfo_apikey.php | ||
| getIP_util.php | ||