From a4942b7e9c1740866929c2c1ce1f161b687b8dac Mon Sep 17 00:00:00 2001 From: Ori Hoch Date: Wed, 7 Feb 2024 19:58:09 +0200 Subject: [PATCH] use x-forwarded-for for x-forwarded-for and remove all logs --- app/Cloudcli/ProxyServerHttp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Cloudcli/ProxyServerHttp.php b/app/Cloudcli/ProxyServerHttp.php index 9b45d9d..8ddb7cd 100644 --- a/app/Cloudcli/ProxyServerHttp.php +++ b/app/Cloudcli/ProxyServerHttp.php @@ -28,8 +28,8 @@ static function getHttpClient(Request $request) { "message" => "Missing env var: CLOUDCLI_API_SERVER" ]; } - \Log::info("Request IP: ". $request->ip()); - \Log::info("Request Headers: " . json_encode($request->headers->all())); + // \Log::info("Request IP: ". $request->header("X-Forwarded-For")); + // \Log::info("Request Headers: " . json_encode($request->headers->all())); return [ "error" => false, "server" => $server, @@ -39,7 +39,7 @@ static function getHttpClient(Request $request) { "headers" => [ "AuthClientId" => $request->header("AuthClientId", env("CLOUDCLI_API_CLIENTID")), "AuthSecret" => $request->header("AuthSecret", env("CLOUDCLI_API_SECRET")), - "X-Forwarded-For" => $request->ip(), + "X-Forwarded-For" => $request->header("X-Forwarded-For"), ] ]) ];