mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-04 00:31:50 +02:00
Small fix in EPP regarding different representation of IPv6
This commit is contained in:
parent
5c6ff7f087
commit
ea6a79b5c5
2 changed files with 30 additions and 0 deletions
|
@ -76,6 +76,9 @@ $server->handle(function (Connection $conn) use ($table, $pool, $c, $log, $permi
|
|||
// Get the client information
|
||||
$clientInfo = $conn->exportSocket()->getpeername();
|
||||
$clientIP = isset($clientInfo['address']) ? (strpos($clientInfo['address'], '::ffff:') === 0 ? substr($clientInfo['address'], 7) : $clientInfo['address']) : '';
|
||||
if (isIPv6($clientIP)) {
|
||||
$clientIP = expandIPv6($clientIP);
|
||||
}
|
||||
|
||||
// Check if the IP is in the permitted list
|
||||
if (!$permittedIPsTable->exist($clientIP)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue