X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/65b63bbe99fa2a80705c289f3f5a30386eb718a7..452b8eada34a0857aee8b5ea2a1dcb0a550626d3:/api/common_api.php diff --git a/api/common_api.php b/api/common_api.php index ccb1442..44e9ab9 100644 --- a/api/common_api.php +++ b/api/common_api.php @@ -23,6 +23,7 @@ if (str_contains($_SERVER['SERVER_SOFTWARE'], 'Apache') && // Only now make the connection (this can take a short while) include "../inc/connection.php"; +header("Content-type: application/json; charset=utf-8"); // Server Side Events if (!defined('NO_EVENT_STREAM_HEADER')) header('Content-Type: text/event-stream'); @@ -56,7 +57,8 @@ function flush_completely() } } -flush_completely(); +if (!defined('NO_EVENT_STREAM_HEADER')) + flush_completely(); /* Send server-sent events (SSE) message */ function send_sse($json)