Skip to content

Commit 4f9e1a9

Browse files
authored
use correct name for accessing the X-Real-IP header via $_SERVER variable (librespeed#365)
1 parent a69a70f commit 4f9e1a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/getIP.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function getClientIp()
1818
{
1919
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
2020
$ip = $_SERVER['HTTP_CLIENT_IP'];
21-
} elseif (!empty($_SERVER['X-Real-IP'])) {
22-
$ip = $_SERVER['X-Real-IP'];
21+
} elseif (!empty($_SERVER['HTTP_X_REAL_IP'])) {
22+
$ip = $_SERVER['HTTP_X_REAL_IP'];
2323
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
2424
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
2525
$ip = preg_replace('/,.*/', '', $ip); # hosts are comma-separated, client is first

0 commit comments

Comments
 (0)