Skip to content

Commit

Permalink
Enhance remote IP detection in LaravelValetDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-chetan committed Nov 8, 2024
1 parent ebcdd8f commit ba6ae7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/Valet/Drivers/LaravelValetDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public function beforeLoading(string $sitePath, string $siteName, string $uri):

public function remoteIP()
{
if ($_SERVER['HTTP_CF_CONNECTING_IP'] ?? false) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
}

if ($_SERVER['HTTP_X_REAL_IP'] ?? false) {
return $_SERVER['HTTP_X_REAL_IP'];
}
Expand Down

0 comments on commit ba6ae7d

Please sign in to comment.