File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
src/Symfony/Component/HttpFoundation Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ class BinaryFileResponse extends Response
31
31
* @var File
32
32
*/
33
33
protected $ file ;
34
- protected $ offset ;
35
- protected $ maxlen ;
34
+ protected $ offset = 0 ;
35
+ protected $ maxlen = - 1 ;
36
36
protected $ deleteFileAfterSend = false ;
37
37
38
38
/**
Original file line number Diff line number Diff line change @@ -206,6 +206,19 @@ public function provideFullFileRanges()
206
206
);
207
207
}
208
208
209
+ public function testUnpreparedResponseSendsFullFile ()
210
+ {
211
+ $ response = BinaryFileResponse::create (__DIR__ .'/File/Fixtures/test.gif ' , 200 );
212
+
213
+ $ data = file_get_contents (__DIR__ .'/File/Fixtures/test.gif ' );
214
+
215
+ $ this ->expectOutputString ($ data );
216
+ $ response = clone $ response ;
217
+ $ response ->sendContent ();
218
+
219
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
220
+ }
221
+
209
222
/**
210
223
* @dataProvider provideInvalidRanges
211
224
*/
You can’t perform that action at this time.
0 commit comments