FIX: Client IP Address may be truncated in download statistics
Created:
4/9/2026 8:02:50 AM by Rich H
Status:
Awaiting Release on
Last pulled:
4/17/2026 10:12:52 PM
Description:
Two things need to be fixed here:
1. IP Address in the format of `::ffff:###.###.###.###` should only show the IP v4 address
2. Increase column size to support IPv6 (39 characters)
Will need to update truncates on IP address in code.
Extensions.cs Line 108:
```
var clientIpAddress = ((request.NativeRequest?.HttpContext?.Connection?.RemoteIpAddress?.ToString() ?? request.UserHostAddress));
if (clientIpAddress.StartsWith("::ffff:", StringComparison.OrdinalIgnoreCase) && clientIpAddress.Contains("."))
clientIpAddress = clientIpAddress["::ffff:".Length..];
return clientIpAddress.Truncate(39)!;
```
PackageFeed.PackageGet.cs line 359
We will also need to follow usages of context.Request.GetClientIPAddress() and update database tables as needed.