فهرست منبع

Don't always explode the TRUST_PROXIES variable

asonix 5 سال پیش
والد
کامیت
cb6e8a4eaa
1فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 9 1
      config/trustedproxy.php

+ 9 - 1
config/trustedproxy.php

@@ -1,5 +1,13 @@
 <?php
 
+$proxyString = env('TRUST_PROXIES', '');
+
+if ($proxyString == '*' || $proxyString == '**') {
+    $proxies = $proxyString;
+} else {
+    $proxies = explode(',', $proxyString);
+}
+
 return [
     /*
      * Set trusted proxy IP addresses.
@@ -23,5 +31,5 @@ return [
      * how many proxies that client's request has
      * subsequently passed through.
      */
-    'proxies' => explode(',', env('TRUST_PROXIES', '')),
+    'proxies' => $proxies,
 ];