$response->
setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT,
$iso88591EncodedFilename);
// the parameter filename* is invalid in this case (rawurldecode('f%F6%F6') does not provide a UTF-8 string but an ISO-8859-1 encoded one)
$this->
assertSame('attachment; filename=f__.html; filename*=utf-8\'\'f%F6%F6.html',
$response->headers->
get('Content-Disposition'
));
} /**
* @dataProvider provideRanges
*/
public function testRequests($requestRange,
$offset,
$length,
$responseRange) { $response =
(new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif', 200,
['Content-Type' => 'application/octet-stream'
]))->
setAutoEtag();
// do a request to get the ETag
$request = Request::
create('/'
);
$response->
prepare($request);
$etag =
$response->headers->
get('ETag'
);
// prepare a request for a range of the testing file
$request = Request::
create('/'
);
$request->headers->
set('If-Range',
$etag);
$request->headers->
set('Range',
$requestRange);