Use X-REQUEST-ID for Error pages

This commit is contained in:
Philipp 2022-12-26 21:17:32 +01:00
parent 5584e7a4e5
commit 4f1bb0d274
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
55 changed files with 218 additions and 130 deletions

View file

@ -573,13 +573,14 @@ class App
* @param IManagePersonalConfigValues $pconfig
* @param Authentication $auth The Authentication backend of the node
* @param App\Page $page The Friendica page printing container
* @param ModuleHTTPException $httpException The possible HTTP Exception container
* @param HTTPInputData $httpInput A library for processing PHP input streams
* @param float $start_time The start time of the overall script execution
*
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, HTTPInputData $httpInput, float $start_time)
public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time)
{
$this->profiler->set($start_time, 'start');
$this->profiler->set(microtime(true), 'classinit');
@ -713,9 +714,9 @@ class App
$httpinput = $httpInput->process();
$input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
// Let the module run it's internal process (init, get, post, ...)
// Let the module run its internal process (init, get, post, ...)
$timestamp = microtime(true);
$response = $module->run($input);
$response = $module->run($httpException, $input);
$this->profiler->set(microtime(true) - $timestamp, 'content');
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
$page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $this->session->getLocalUserId());
@ -723,7 +724,7 @@ class App
$page->exit($response);
}
} catch (HTTPException $e) {
(new ModuleHTTPException())->rawContent($e);
$httpException->rawContent($e);
}
$page->logRuntime($this->config, 'runFrontend');
}