Skip to content

Commit fc2cd95

Browse files
[8.x] Extract method to get proxies (#38386)
* Extract method to get proxies * Update TrustProxies.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 9bfe672 commit fc2cd95

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Illuminate/Http/Middleware/TrustProxies.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TrustProxies
1010
/**
1111
* The trusted proxies for the application.
1212
*
13-
* @var string|array|null
13+
* @var array|string|null
1414
*/
1515
protected $proxies;
1616

@@ -47,7 +47,7 @@ public function handle(Request $request, Closure $next)
4747
*/
4848
protected function setTrustedProxyIpAddresses(Request $request)
4949
{
50-
$trustedIps = $this->proxies;
50+
$trustedIps = $this->proxies();
5151

5252
if ($trustedIps === '*' || $trustedIps === '**') {
5353
return $this->setTrustedProxyIpAddressesToTheCallingIp($request);
@@ -123,4 +123,14 @@ protected function getTrustedHeaderNames()
123123

124124
return $this->headers;
125125
}
126+
127+
/**
128+
* Get the trusted proxies.
129+
*
130+
* @return array|string|null
131+
*/
132+
protected function proxies()
133+
{
134+
return $this->proxies;
135+
}
126136
}

0 commit comments

Comments
 (0)