Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Commit

Permalink
Prepare request for BinaryFileResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
anhskohbo committed Apr 25, 2018
1 parent 324e44e commit c089f1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Awethemes\Http\Resolver\Simple_Resolver;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Psr\Http\Message\ResponseInterface as PsrResponseInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Component\Debug\Exception\FatalThrowableError;
Expand Down Expand Up @@ -305,6 +306,8 @@ protected function prepare_response( $response ) {
$response = ( new HttpFoundationFactory )->createResponse( $response );
} elseif ( ! $response instanceof SymfonyResponse ) {
$response = new Response( $response );
} elseif ( $response instanceof BinaryFileResponse ) {
$response = $response->prepare( Request::capture() );
}

return $response;
Expand Down

0 comments on commit c089f1f

Please sign in to comment.