MAPG-69 initialize Request earlier

add Request to global Container
add base URL to Request
This commit is contained in:
bence committed 2020-06-14 17:11:48 +02:00
1 parent 142c91f36b
commit c50c5ed422
5 files changed
+28 -11

No files matched your search

+4 -2
View File
@@ -40,6 +40,8 @@ session_start([
'cookie_samesite' => 'Lax'
]);
if (!isset($_SESSION['anti_csrf_token'])) {
$_SESSION['anti_csrf_token'] = hash('sha256', random_bytes(10) . microtime());
Container::$request = new MapGuesser\Request\Request($_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'], $_GET, $_POST, $_SESSION);
if (!Container::$request->session()->has('anti_csrf_token')) {
Container::$request->session()->set('anti_csrf_token', hash('sha256', random_bytes(10) . microtime()));
}