From ed0e14cb3289a0d8ae6054f646666f0601af06ce Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:58:23 +0800 Subject: [PATCH] fix(admin): use direct IP retrieval for system logs Direct IP retrieval method has been updated to improve accuracy in the admin system log. This change involves modifying the IP address retrieval logic from considering the `HTTP_X_FORWARDED_FOR` header to directly using the `ip()` method, potentially enhancing the security and reliability of IP logging. --- app/admin/middleware/SystemLog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/middleware/SystemLog.php b/app/admin/middleware/SystemLog.php index 77521ea..183fbd1 100644 --- a/app/admin/middleware/SystemLog.php +++ b/app/admin/middleware/SystemLog.php @@ -62,7 +62,7 @@ class SystemLog } }catch (\Throwable $exception) { } - $ip = $request->server('HTTP_X_FORWARDED_FOR', $request->ip()); + $ip = $request->ip(); $data = [ 'admin_id' => session('admin.id'), 'title' => $title,