From ccef28d1929befe9422701addcd654447c9f17d5 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 3 Aug 2023 09:00:15 +0200 Subject: [PATCH] always send Content-Type: application/json --- mail/src/ApiHandler.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mail/src/ApiHandler.php b/mail/src/ApiHandler.php index 4cc9e04231..0c37240576 100644 --- a/mail/src/ApiHandler.php +++ b/mail/src/ApiHandler.php @@ -58,6 +58,7 @@ class ApiHandler extends Api\CalDAV\Handler throw new \Exception("/mail is NOT available for users other than the one you authenticated!", 403); } } + header('Content-Type: application/json'); try { if (str_starts_with($path, '/mail/attachments/')) @@ -95,7 +96,6 @@ class ApiHandler extends Api\CalDAV\Handler } $push = new Api\Json\Push($user); $push->call('egw.open', '', 'mail', 'add', ['preset' => $preset], '_blank', 'mail'); - header('Content-Type: application/json'); echo json_encode([ 'status' => 200, 'message' => 'Request to open compose window sent', @@ -125,7 +125,6 @@ class ApiHandler extends Api\CalDAV\Handler ]+$preset); if ($compose->send($preset, $acc_id)) { - header('Content-Type: application/json'); echo json_encode(array_filter([ 'status' => 200, 'warning' => $warning ?? null, @@ -285,7 +284,6 @@ class ApiHandler extends Api\CalDAV\Handler { if (isset($fp)) fclose($fp); header('Location: '.($location = '/mail/attachments/'.substr(basename($attachment_path), 8))); - header('Content-Type: application/json'); echo json_encode([ 'status' => 200, 'message' => 'Attachment stored',