[BUGFIX] Reintroduce support for reverseProxySSL 01/44001/6
authorajahn <jahn.typo3@googlemail.com>
Mon, 12 Oct 2015 08:06:44 +0000 (10:06 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 2 Dec 2015 14:16:14 +0000 (15:16 +0100)
Creating a backend request relies on TYPO3_CONF_VARS which
is not set yet.
This breaks requests when using a reverse proxy for SSL
because HTTP is used as scheme even thogh HTTPS should be used.

Change-Id: Id3f5fe2189f5bcc017da8ebcc21cc43920917aa0
Resolves: #70525
Releases: master
Reviewed-on: https://review.typo3.org/44001
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/Http/Application.php

index df54485..faa247b 100644 (file)
@@ -72,14 +72,6 @@ class Application implements ApplicationInterface
             $this->bootstrap->registerRequestHandlerImplementation($requestHandler);
         }
 
-        $this->request = \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals();
-        // see below when this option is set
-        if ($GLOBALS['TYPO3_AJAX']) {
-            $this->request = $this->request->withAttribute('isAjaxRequest', true);
-        } elseif (isset($this->request->getQueryParams()['M'])) {
-            $this->request = $this->request->withAttribute('isModuleRequest', true);
-        }
-
         $this->bootstrap->configure();
     }
 
@@ -91,6 +83,14 @@ class Application implements ApplicationInterface
      */
     public function run(callable $execute = null)
     {
+        $this->request = \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals();
+        // see below when this option is set and Bootstrap::defineTypo3RequestTypes() for more details
+        if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
+            $this->request = $this->request->withAttribute('isAjaxRequest', true);
+        } elseif (isset($this->request->getQueryParams()['M'])) {
+            $this->request = $this->request->withAttribute('isModuleRequest', true);
+        }
+
         $this->bootstrap->handleRequest($this->request);
 
         if ($execute !== null) {