From 2fd885cd8560a56274d49391fd2a20254ffaea3f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 28 Jan 2025 11:27:44 +0000 Subject: [PATCH] MDL-72080 javascript: explicit Content-Type in service responses. This fixes various external methods that initialize page output manually, e.g. `core_get_fragment`, which can mess with third party proxies that modify data in transit because of the current default response type header (text/html). Co-authored-by: Mario Torres --- lib/ajax/service.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ajax/service.php b/lib/ajax/service.php index 46218adf3a368..469067a3b03c3 100644 --- a/lib/ajax/service.php +++ b/lib/ajax/service.php @@ -115,4 +115,5 @@ header('Accept-Ranges: none'); } +header('Content-Type: application/json; charset=utf-8'); echo json_encode($responses);