mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
parent
06cf175b08
commit
56d5af1336
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace BookStack\Http\Middleware;
|
namespace BookStack\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||||
|
|
||||||
@ -26,4 +27,21 @@ class TrustProxies extends Middleware
|
|||||||
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT',
|
||||||
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the request, Set the correct user-configured proxy information.
|
||||||
|
* @param Request $request
|
||||||
|
* @param Closure $next
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
$setProxies = config('app.proxies');
|
||||||
|
if ($setProxies !== '**' && $setProxies !== '*' && $setProxies !== '') {
|
||||||
|
$setProxies = explode(',', $setProxies);
|
||||||
|
}
|
||||||
|
$this->proxies = $setProxies;
|
||||||
|
|
||||||
|
return parent::handle($request, $next);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,4 +234,6 @@ return [
|
|||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'proxies' => env('APP_PROXIES', ''),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user