Page MenuHomePhabricator

D21055.id50160.diff
No OneTemporary

D21055.id50160.diff

diff --git a/src/aphront/response/AphrontResponse.php b/src/aphront/response/AphrontResponse.php
--- a/src/aphront/response/AphrontResponse.php
+++ b/src/aphront/response/AphrontResponse.php
@@ -417,13 +417,19 @@
}
public function willBeginWrite() {
- if ($this->shouldCompressResponse()) {
- // Enable automatic compression here. Webservers sometimes do this for
- // us, but we now detect the absence of compression and warn users about
- // it so try to cover our bases more thoroughly.
- ini_set('zlib.output_compression', 1);
- } else {
- ini_set('zlib.output_compression', 0);
+ // If we've already sent headers, these "ini_set()" calls will warn that
+ // they have no effect. Today, this always happens because we're inside
+ // a unit test, so just skip adjusting the setting.
+
+ if (!headers_sent()) {
+ if ($this->shouldCompressResponse()) {
+ // Enable automatic compression here. Webservers sometimes do this for
+ // us, but we now detect the absence of compression and warn users about
+ // it so try to cover our bases more thoroughly.
+ ini_set('zlib.output_compression', 1);
+ } else {
+ ini_set('zlib.output_compression', 0);
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 2:29 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223372
Default Alt Text
D21055.id50160.diff (1 KB)

Event Timeline