Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | protected function generateBinaryResponse($path, $extraHeaders = []) |
||
28 | { |
||
29 | $body = new Stream($path); |
||
30 | return new Response($body, 200, ArrayUtils::merge([ |
||
31 | 'Content-Type' => (new \finfo(FILEINFO_MIME))->file($path), |
||
32 | 'Content-Length' => (string) $body->getSize(), |
||
33 | ], $extraHeaders)); |
||
34 | } |
||
35 | } |
||
36 |