1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-10 00:30:09 +00:00

Compress JSON with GZip if enabled

This commit is contained in:
Tim Düsterhus 2012-03-04 17:16:25 +01:00
parent 94aec081ba
commit ef72a875e5

View File

@ -66,6 +66,11 @@ public function show() {
parent::show();
@header('Content-type: application/json');
// enable gzip compression
if (HTTP_ENABLE_GZIP && HTTP_GZIP_LEVEL > 0 && HTTP_GZIP_LEVEL < 10 && !defined('HTTP_DISABLE_GZIP')) {
\wcf\util\HeaderUtil::compressOutput();
}
$json = array('users' => array(), 'messages' => array());
foreach ($this->messages as $message) {