symfony/symfony — pull request #9714 by SimonSimCity (2013-12-06 13:22:51+00:00)
Title: [HttpFoundation] BinaryFileResponse should also return 416 or 200 on some range-requets

I read around in the docs and tried something with BinaryFileResponse ... There are two things I missed in the implementation here:

# If the range, provided in the query, does exceed the file-position, return an 416 (or 200 - I decided to take 416 here)
# If the range is logical invalid (f.e. to request from byte 50 to byte 30 ..) return 200 - OK

One decision I took in addition, is to provide a 200 code if the full file is requested. For me, it doesn't make sense here to return a 206 for just the complete file.

What I'm quite unsure about: Do we need some additional fields for these two options? I can remember reading something about a Content-Range for 416 but I was quite unsure what it should be ...