1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-23 12:09:12 +01:00

When requesting file data, make "Range: bytes=0-" work correctly

Summary: Ref T12219. Chrome can send requests with a "Range: bytes=0-" header, which just means "the whole file", but we don't respond correctly because of a `null` vs `0` issue.

Test Plan: Sent a raw `bytes=0-` request, saw a proper resonse.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12219

Differential Revision: https://secure.phabricator.com/D17627
This commit is contained in:
epriestley 2017-04-05 11:31:59 -07:00
parent d1a971e221
commit f2a26b2601

View file

@ -94,7 +94,7 @@ final class AphrontFileResponse extends AphrontResponse {
array('Accept-Ranges', 'bytes'),
);
if ($this->rangeMin || $this->rangeMax) {
if ($this->rangeMin !== null || $this->rangeMax !== null) {
$len = $this->getContentLength();
$min = $this->rangeMin;