Skip to content
Snippets Groups Projects
Commit 649d9341 authored by catch's avatar catch
Browse files

Merge branch '3419024-binary-file-response' into '11.x'

Resolve #3419024 "Binary file response"

See merge request !6453
parents 577b6900 33452a61
No related branches found
No related tags found
No related merge requests found
Pipeline #87905 passed
Pipeline: drupal

#87909

    ......@@ -3,6 +3,7 @@
    namespace Drupal\Core\StackMiddleware;
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpFoundation\BinaryFileResponse;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\HttpKernel\HttpKernelInterface;
    ......@@ -26,6 +27,11 @@ public function __construct(
    */
    public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = TRUE): Response {
    $response = $this->httpKernel->handle($request, $type, $catch);
    // Don't set a content-length header for files because they may be gzipped
    // by the server.
    if ($response instanceof BinaryFileResponse) {
    return $response;
    }
    if ($response->isInformational() || $response->isEmpty()) {
    return $response;
    }
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment