Skip to content

Commit 43e45dd

Browse files
committed
Installation fails without a Session
1 parent 7fe880f commit 43e45dd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

webapp/src/Service/DOMJudgeService.php

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
use Symfony\Component\HttpFoundation\Request;
5050
use Symfony\Component\HttpFoundation\RequestStack;
5151
use Symfony\Component\HttpFoundation\Response;
52+
use Symfony\Component\HttpFoundation\Session\Session;
5253
use Symfony\Component\HttpFoundation\StreamedResponse;
5354
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
5455
use Symfony\Component\HttpKernel\Exception\HttpException;
@@ -627,6 +628,8 @@ public function internalApiRequest(string $url, string $method = Request::METHOD
627628
$request = Request::create('/api' . $url, $method, $queryOrPostData, [], $files);
628629
if ($this->requestStack->getCurrentRequest() && $this->requestStack->getCurrentRequest()->hasSession()) {
629630
$request->setSession($this->requestStack->getSession());
631+
} else {
632+
$request->setSession(new Session());
630633
}
631634
$response = $this->httpKernel->handle($request, HttpKernelInterface::SUB_REQUEST);
632635

0 commit comments

Comments
 (0)