[+BUGFIX] Extbase (MVC): The headers added by Response::setHeader() are sent now...
authorJochen Rau <j.rau@web.de>
Tue, 15 Jun 2010 10:02:35 +0000 (10:02 +0000)
committerJochen Rau <j.rau@web.de>
Tue, 15 Jun 2010 10:02:35 +0000 (10:02 +0000)
typo3/sysext/extbase/Classes/Dispatcher.php
typo3/sysext/extbase/Classes/MVC/Web/Response.php

index e3f46b8..27b6930 100644 (file)
@@ -144,14 +144,10 @@ class Tx_Extbase_Dispatcher {
 
                self::$reflectionService->shutdown();
                
-               if (substr($response->getStatus(), 0, 3) === '303') {
-                       $response->sendHeaders();
-                       exit;
-               }
-
                if (count($response->getAdditionalHeaderData()) > 0) {
                        $GLOBALS['TSFE']->additionalHeaderData[$request->getControllerExtensionName()] = implode("\n", $response->getAdditionalHeaderData());
                }
+               $response->sendHeaders();
                $this->timeTrackPull();
                return $response->getContent();
        }
index c3c13eb..9a82473 100755 (executable)
@@ -55,7 +55,7 @@ class Tx_Extbase_MVC_Web_Response extends Tx_Extbase_MVC_Response {
         *
         * @var integer
         */
-       protected $statusCode = 200;
+       protected $statusCode;
 
        /**
         * The HTTP status message
@@ -169,10 +169,11 @@ class Tx_Extbase_MVC_Web_Response extends Tx_Extbase_MVC_Response {
         */
        public function getHeaders() {
                $preparedHeaders = array();
-               $protocolVersion = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
-               $statusHeader = $protocolVersion . ' ' . $this->statusCode . ' ' . $this->statusMessage;
-
-               $preparedHeaders[] = $statusHeader;
+               if ($this->statusCode !== NULL) {
+                       $protocolVersion = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
+                       $statusHeader = $protocolVersion . ' ' . $this->statusCode . ' ' . $this->statusMessage;
+                       $preparedHeaders[] = $statusHeader;
+               }
                foreach ($this->headers as $name => $values) {
                        foreach ($values as $value) {
                                $preparedHeaders[] = $name . ': ' . $value;