Skip to content

Commit

Permalink
Replace RunnableResponse with StreamedResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Aug 21, 2024
1 parent 581a7ab commit 47654f9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Controller/DiscoPower.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@

use Exception;
use SimpleSAML\Error;
use SimpleSAML\HTTP\RunnableResponse;
use SimpleSAML\Module\discopower\PowerIdPDisco;
use SimpleSAML\Session;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\{JsonResponse, Request, Response, StreamedResponse};

class DiscoPower
{
/**
* @param \Symfony\Component\HttpFoundation\Request $request The current request.
* @return \SimpleSAML\HTTP\RunnableResponse
* @return \Symfony\Component\HttpFoundation\StreamedResponse
*/
public function main(Request $request): RunnableResponse
public function main(Request $request): StreamedResponse
{
try {
$discoHandler = new PowerIdPDisco(
Expand All @@ -32,7 +29,7 @@ public function main(Request $request): RunnableResponse
}

try {
return new RunnableResponse([$discoHandler, 'handleRequest'], []);
return new StreamedResponse([$discoHandler, 'handleRequest']);
} catch (Exception $exception) {
// An error here should be caused by metadata
throw new Error\Error('METADATA', $exception);
Expand Down

0 comments on commit 47654f9

Please sign in to comment.