Details
-
Bug
-
Resolution: Fixed
-
Medium
-
3.0.5, 2.5.11
-
None
-
None
Description
InjectCrossOriginHelperSubscriber checks if response "is attachment" by comparing Content-Disposition header value to attachment;, which will fail with
Content-Disposition: attachment
Steps to reproduce
1. Clean installation of eZ Platform 2.5
2. Create a new src/AppBundle/Controller/TestController:
<?php namespace AppBundle\Controller; use Symfony\Component\HttpFoundation\StreamedResponse; class TestController { public function downloadAction() { $response = new StreamedResponse(); $response->headers->set('Content-Disposition', 'attachment'); $response->setCallback(function () { var_dump('Hello World'); flush(); var_dump('Hello World'); flush(); }); $response->send(); return $response; } }
3. Add route for it - in app/config/routing.yml add at the begnining:
test: path: /test defaults: { _controller: AppBundle:Test:download }
4. In your browser go to http://<your_project>/test.
5. Check logs/profiler for the request
Result
FatalThrowableError Type error: stripos() expects parameter 1 to be string, bool given