Skip to content

Commit

Permalink
MDL-72080 javascript: explicit Content-Type in service responses.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
paulholden committed Jan 28, 2025
1 parent bcf06a0 commit 2fd885c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/ajax/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@
header('Accept-Ranges: none');
}

header('Content-Type: application/json; charset=utf-8');
echo json_encode($responses);

0 comments on commit 2fd885c

Please sign in to comment.