Created
February 26, 2016 13:56
-
-
Save garbast/17b2873375f4c6a27008 to your computer and use it in GitHub Desktop.
Quick solution for requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/typo3/sysext/core/Classes/Http/ServerRequestFactory.php b/typo3/sysext/core/Classes/Http/ServerRequestFactory.php | |
index bee3e59..7b9cf82 100644 | |
--- a/typo3/sysext/core/Classes/Http/ServerRequestFactory.php | |
+++ b/typo3/sysext/core/Classes/Http/ServerRequestFactory.php | |
@@ -27,6 +27,23 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; | |
class ServerRequestFactory | |
{ | |
/** | |
+ * First request instantiated | |
+ * | |
+ * @var ServerRequest | |
+ */ | |
+ protected static $initialRequest; | |
+ | |
+ /** | |
+ * Returns the first request instantiated from superglobal variables. | |
+ * | |
+ * @return ServerRequest | |
+ */ | |
+ public static function getInitialRequest() | |
+ { | |
+ return self::$initialRequest; | |
+ } | |
+ | |
+ /** | |
* Create a request from the original superglobal variables. | |
* | |
* @return ServerRequest | |
@@ -61,6 +78,9 @@ class ServerRequestFactory | |
if (!empty($parsedBody)) { | |
$request = $request->withParsedBody($parsedBody); | |
} | |
+ if (is_null(self::$initialRequest)) { | |
+ self::$initialRequest = $request; | |
+ } | |
return $request; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment