Page MenuHomePhabricator

If HTTP response headers are already sent, don't fiddle with "zlib.output_compression"
ClosedPublic

Authored by epriestley on Apr 3 2020, 7:21 PM.
Tags
None
Referenced Files
F19083211: D21055.id50161.diff
Tue, Dec 2, 12:32 PM
F19075389: D21055.id.diff
Mon, Dec 1, 9:42 AM
F18994058: D21055.id50160.diff
Wed, Nov 19, 9:46 AM
F18985377: D21055.id50160.diff
Mon, Nov 17, 1:00 PM
F18851328: D21055.id50161.diff
Oct 30 2025, 11:57 PM
F18824340: D21055.id.diff
Oct 23 2025, 3:18 PM
F18822037: D21055.diff
Oct 23 2025, 3:47 AM
F18734183: D21055.id.diff
Sep 30 2025, 10:49 PM
Subscribers
None

Details

Summary

We write some synthetic HTTP responses inside unit tests. Some responses have an indirect side effect of adjusting "zlib.output_compression", but this adjustment fails if headers have already been output. From a CLI context, headers appear to count as already-output after we write anything to stdout:

<?php

echo headers_sent() ? "Y" : "N";
echo "\n";
echo headers_sent() ? "Y" : "N";
echo "\n";

This script prints "N", then "Y".

Recently, the default severity of warnings was increased in libphutil; this has been a long-standing warning but now causes test failures.

This behavior is sort of silly but the whole thing is kind of moot anyway. Just skip it if "headers_sent()" is true.

Test Plan

Ran "arc unit --everything", got clean results.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable