X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=db3e644c2fc4391a6716c3cfb184b8b6fe29d694;hb=e231907b3c00223909bfbef19998a42d3e198a4a;hp=249c9f66ac6c52d1edbed97a5a4237d32235f7b3;hpb=fa375377627accbff58444b1ac3ced193159d0aa;p=friendica.git diff --git a/src/App.php b/src/App.php index 249c9f66ac..db3e644c2f 100644 --- a/src/App.php +++ b/src/App.php @@ -581,6 +581,7 @@ class App // Force SSL redirection if ($this->config->get('system', 'force_ssl') && (empty($server['HTTPS']) || $server['HTTPS'] === 'off') && + (empty($server['HTTP_X_FORWARDED_PROTO']) || $server['HTTP_X_FORWARDED_PROTO'] === 'http') && !empty($server['REQUEST_METHOD']) && $server['REQUEST_METHOD'] === 'GET') { System::externalRedirect($this->baseURL . '/' . $this->args->getQueryString()); @@ -694,6 +695,9 @@ class App $module = $router->getModule(); } + // Display can change depending on the requested language, so it shouldn't be cached whole + header('Vary: Accept-Language', false); + // Processes data from GET requests $httpinput = $httpInput->process(); $input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST); @@ -702,11 +706,13 @@ class App $timestamp = microtime(true); $response = $module->run($httpException, $input); $this->profiler->set(microtime(true) - $timestamp, 'content'); + + // Wrapping HTML responses in the theme template 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, $nav, $this->session->getLocalUserId()); - } else { - $page->exit($response); + $response = $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig, $nav, $this->session->getLocalUserId()); } + + $page->exit($response); } catch (HTTPException $e) { $httpException->rawContent($e); }