From 98da37076d83be60117615200789956fb3204e77 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sat, 21 Jan 2023 21:06:06 +0100 Subject: [PATCH] Add more transparent errors and make it possible to see them in logs --- src/App/BaseURL.php | 4 ++++ src/App/Request.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App/BaseURL.php b/src/App/BaseURL.php index d394dfce95..f02cb9ef99 100644 --- a/src/App/BaseURL.php +++ b/src/App/BaseURL.php @@ -264,6 +264,10 @@ class BaseURL $this->sslPolicy = $this->config->get('system', 'ssl_policy') ?? static::DEFAULT_SSL_SCHEME; $this->url = $this->config->get('system', 'url'); + if (empty($this->hostname) || empty($this->url)) { + throw new \Exception('Invalid config - Missing system.url or config.hostname'); + } + $this->determineSchema(); } diff --git a/src/App/Request.php b/src/App/Request.php index 675841ae76..d61303d5d7 100644 --- a/src/App/Request.php +++ b/src/App/Request.php @@ -74,7 +74,7 @@ class Request public function __construct(IManageConfigValues $config, array $server = []) { $this->remoteAddress = $this->determineRemoteAddress($config, $server); - $this->requestId = $server[static::DEFAULT_REQUEST_ID_HEADER] ?? System::createGUID(8); + $this->requestId = $server[static::DEFAULT_REQUEST_ID_HEADER] ?? System::createGUID(8, false); } /**