From fb87f5f173ad4f78bf1ac7ce4745fec3f7e5cc8a 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 d12b0d3bc9..8be97dfc6d 100644 --- a/mail/src/ApiHandler.php +++ b/mail/src/ApiHandler.php @@ -54,6 +54,7 @@ class ApiHandler extends Api\CalDAV\Handler $prefix = '/'.Api\Accounts::id2name($user); if (str_starts_with($path, $prefix)) $path = substr($path, strlen($prefix)); } + header('Content-Type: application/json'); try { if (str_starts_with($path, '/mail/attachments/')) @@ -91,7 +92,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', @@ -121,7 +121,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, @@ -252,7 +251,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',