[HttpFoundation] removed wrong HTTP header
This commit is contained in:
parent
87e0e220f6
commit
73dddac4e0
@ -170,7 +170,6 @@ class BinaryFileResponse extends Response
|
|||||||
{
|
{
|
||||||
$this->headers->set('Content-Length', $this->file->getSize());
|
$this->headers->set('Content-Length', $this->file->getSize());
|
||||||
$this->headers->set('Accept-Ranges', 'bytes');
|
$this->headers->set('Accept-Ranges', 'bytes');
|
||||||
$this->headers->set('Content-Transfer-Encoding', 'binary');
|
|
||||||
|
|
||||||
if (!$this->headers->has('Content-Type')) {
|
if (!$this->headers->has('Content-Type')) {
|
||||||
$this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream');
|
$this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream');
|
||||||
|
@ -77,7 +77,6 @@ class BinaryFileResponseTest extends ResponseTestCase
|
|||||||
$response->sendContent();
|
$response->sendContent();
|
||||||
|
|
||||||
$this->assertEquals(206, $response->getStatusCode());
|
$this->assertEquals(206, $response->getStatusCode());
|
||||||
$this->assertEquals('binary', $response->headers->get('Content-Transfer-Encoding'));
|
|
||||||
$this->assertEquals($responseRange, $response->headers->get('Content-Range'));
|
$this->assertEquals($responseRange, $response->headers->get('Content-Range'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +112,6 @@ class BinaryFileResponseTest extends ResponseTestCase
|
|||||||
$response->sendContent();
|
$response->sendContent();
|
||||||
|
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
$this->assertEquals('binary', $response->headers->get('Content-Transfer-Encoding'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideFullFileRanges()
|
public function provideFullFileRanges()
|
||||||
@ -144,7 +142,6 @@ class BinaryFileResponseTest extends ResponseTestCase
|
|||||||
$response->sendContent();
|
$response->sendContent();
|
||||||
|
|
||||||
$this->assertEquals(416, $response->getStatusCode());
|
$this->assertEquals(416, $response->getStatusCode());
|
||||||
$this->assertEquals('binary', $response->headers->get('Content-Transfer-Encoding'));
|
|
||||||
#$this->assertEquals('', $response->headers->get('Content-Range'));
|
#$this->assertEquals('', $response->headers->get('Content-Range'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user