From f2a26b2601000765fcd79f7654f90fc3abdd09e2 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 5 Apr 2017 11:31:59 -0700 Subject: [PATCH] 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 --- src/aphront/response/AphrontFileResponse.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aphront/response/AphrontFileResponse.php b/src/aphront/response/AphrontFileResponse.php index 25750ddacd..9699c49ad4 100644 --- a/src/aphront/response/AphrontFileResponse.php +++ b/src/aphront/response/AphrontFileResponse.php @@ -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;