mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
Fix agent detection: real client IP via CF header, tablet/iPad support, subnet fallback match
This commit is contained in:
@@ -213,7 +213,9 @@ switch ($agentAction) {
|
||||
foreach ($agents as &$a) {
|
||||
$a['capabilities'] = json_decode($a['capabilities'] ?? '[]', true);
|
||||
}
|
||||
agent_ok(['agents' => $agents, 'my_ip' => $_SERVER['REMOTE_ADDR'] ?? '']);
|
||||
$realIp = $_SERVER['HTTP_CF_CONNECTING_IP'] ?? $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'] ?? '';
|
||||
$realIp = trim(explode(',', $realIp)[0]);
|
||||
agent_ok(['agents' => $agents, 'my_ip' => $realIp]);
|
||||
|
||||
// ── LATEST METRICS (for dashboard display) ───────────────────────────────
|
||||
case 'status':
|
||||
|
||||
Reference in New Issue
Block a user