]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
Add HTTP method to App\Arguments
[friendica.git] / src / App / Page.php
index 1076142b744138557c9cc26f0b515d6d2a28a865..9e59ab9ae7aeaf6303f605ada1fa51ba4e9b5685 100644 (file)
@@ -32,6 +32,7 @@ use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Theme;
+use Friendica\DI;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
@@ -378,6 +379,12 @@ class Page implements ArrayAccess
         */
        public function exit(ResponseInterface $response)
        {
+               header(sprintf("HTTP/%s %s %s",
+                       $response->getProtocolVersion(),
+                       $response->getStatusCode(),
+                       $response->getReasonPhrase())
+               );
+
                foreach ($response->getHeaders() as $key => $header) {
                        if (is_array($header)) {
                                $header_str = implode(',', $header);
@@ -420,7 +427,6 @@ class Page implements ArrayAccess
                 */
                $timestamp = microtime(true);
                $this->initContent($response, $mode);
-               $profiler->set(microtime(true) - $timestamp, 'content');
 
                // Load current theme info after module has been initialized as theme could have been set in module
                $currentTheme = $app->getCurrentTheme();
@@ -448,6 +454,8 @@ class Page implements ArrayAccess
                 */
                $this->initFooter($app, $mode, $l10n);
 
+               $profiler->set(microtime(true) - $timestamp, 'aftermath');
+
                if (!$mode->isAjax()) {
                        Hook::callAll('page_end', $this->page['content']);
                }