Revert "[BUGFIX] PSR-7: Only send headers if no other headers are prepared" 59/42059/2
authorBenjamin Mack <benni@typo3.org>
Tue, 28 Jul 2015 17:00:03 +0000 (19:00 +0200)
committerBenjamin Mack <benni@typo3.org>
Tue, 28 Jul 2015 17:00:12 +0000 (19:00 +0200)
The AJAX functionality in the backend does not work anymore, thus reverting to the original state, finding a proper solution to solve the problem.

This reverts commit 8e9a766da84cba945767423c722ace454885041a.

Change-Id: Ie0b563c5973a0ea4142c310fbba304c53a114840
Reviewed-on: http://review.typo3.org/42059
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Classes/Core/Bootstrap.php

index 3612776..f9a692d 100644 (file)
@@ -296,12 +296,11 @@ class Bootstrap {
         */
        protected function sendResponse() {
                if ($this->response instanceof \Psr\Http\Message\ResponseInterface) {
-                       // Send the response headers only if no header was sent before
-                       if (!headers_sent() && empty(headers_list())) {
+                       if (!headers_sent()) {
                                foreach ($this->response->getHeaders() as $name => $values) {
                                        header($name . ': ' . implode(', ', $values), FALSE);
                                }
-                               // Send the response type
+                               // send the response type
                                header('HTTP/' . $this->response->getProtocolVersion() . ' ' . $this->response->getStatusCode() . ' ' . $this->response->getReasonPhrase());
                        }
                        echo $this->response->getBody()->__toString();