Skip to content

Commit 7ffdd9b

Browse files
committed
Handle BinaryFileResponse in API CLI correctly
1 parent d8db6cd commit 7ffdd9b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

webapp/src/Service/DOMJudgeService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
use ReflectionClass;
4444
use Symfony\Component\DependencyInjection\Attribute\Autowire;
4545
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
46+
use Symfony\Component\HttpFoundation\BinaryFileResponse;
4647
use Symfony\Component\HttpFoundation\Cookie;
4748
use Symfony\Component\HttpFoundation\File\UploadedFile;
4849
use Symfony\Component\HttpFoundation\InputBag;
@@ -652,7 +653,8 @@ public function internalApiRequest(string $url, string $method = Request::METHOD
652653
return null;
653654
}
654655

655-
if ($response instanceof StreamedResponse) {
656+
if ($response instanceof StreamedResponse ||
657+
$response instanceof BinaryFileResponse) {
656658
ob_start(flags: PHP_OUTPUT_HANDLER_REMOVABLE);
657659
$response->sendContent();
658660
$content = ob_get_clean();

0 commit comments

Comments
 (0)