From 82afd528d6216be0bf3837b152ad3ebca5982aae Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Wed, 8 Jun 2022 13:16:38 +0200 Subject: [PATCH] Resolve #432 --- snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php | 4 +++- snappymail/v/0.0.0/app/libraries/snappymail/http/stream.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 5b95b9069..f0834b12b 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -186,7 +186,9 @@ class ServiceActions $this->Plugins()->RunHook('filter.json-response', array($sAction, &$aResponseItem)); - \header('Content-Type: application/json; charset=utf-8'); + if (!\headers_sent()) { + \header('Content-Type: application/json; charset=utf-8'); + } $sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger()); diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/http/stream.php b/snappymail/v/0.0.0/app/libraries/snappymail/http/stream.php index 3faf24595..0d827f360 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/http/stream.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/http/stream.php @@ -42,7 +42,7 @@ abstract class Stream public static function JSON($data) { echo \MailSo\Base\Utils::Php2js($data) . "\n"; - \ob_flush(); +// \ob_flush(); \flush(); } }