Load site settings from dotenv and store OAuth credentials
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use App\Config\Environment;
|
||||
|
||||
final class Request extends \support\Request
|
||||
{
|
||||
private const LOOPBACK = ['127.0.0.1', '::1'];
|
||||
@@ -21,7 +23,7 @@ final class Request extends \support\Request
|
||||
|
||||
private function fromTrustedProxy(): bool
|
||||
{
|
||||
$configured = getenv('LAYSITE_TRUSTED_PROXIES');
|
||||
$configured = Environment::get('LAYSITE_TRUSTED_PROXIES');
|
||||
$trusted = $configured === false ? self::LOOPBACK : array_map('trim', explode(',', $configured));
|
||||
|
||||
return in_array($this->getRemoteIp(), $trusted, true);
|
||||
|
||||
Reference in New Issue
Block a user