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:
parent
94aec081ba
commit
ef72a875e5
@ -66,6 +66,11 @@ public function show() {
|
|||||||
parent::show();
|
parent::show();
|
||||||
|
|
||||||
@header('Content-type: application/json');
|
@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());
|
$json = array('users' => array(), 'messages' => array());
|
||||||
|
|
||||||
foreach ($this->messages as $message) {
|
foreach ($this->messages as $message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user