MDL-84313 pluginfile: Allow fetching by chunks in cross-site requests

Without these headers, the range headers are blocked so only the first chunk of the file can be retrieved.
This commit is contained in:
Dani Palou
2025-01-23 15:52:35 +01:00
parent a2653cc924
commit 9ecfe28878
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -33,6 +33,8 @@ require_once('config.php');
// Allow CORS requests.
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: range');
header('Access-Control-Expose-Headers: Content-Range');
$relativepath = get_file_argument();
$token = optional_param('token', '', PARAM_ALPHANUM);