From c4c3de7bfaf34c8d85b5deee6cd25f0ff42f4315 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 5 Apr 2017 06:46:26 -0700 Subject: [PATCH] Correct an issue where the wrong "Content-Length" was set for partial content responses Summary: Ref T8266. Although we compute this correctly above, we ignored it when actually setting the header. Use the computed value to set the "Content-Length" header. This is consistent with the spec/documentation. Test Plan: Before, some audio (like `rain.mp3`) was pretty spotty about loading in Safari. It now loads consistently for me locally. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8266 Differential Revision: https://secure.phabricator.com/D17624 --- 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 a8f673d218..6337c984b9 100644 --- a/src/aphront/response/AphrontFileResponse.php +++ b/src/aphront/response/AphrontFileResponse.php @@ -105,7 +105,7 @@ final class AphrontFileResponse extends AphrontResponse { } if (!$this->shouldCompressResponse()) { - $headers[] = array('Content-Length', $this->getContentLength()); + $headers[] = array('Content-Length', $content_len); } if (strlen($this->getDownload())) {