mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
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:
parent
e6c92dc291
commit
53e2e59432
@ -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);
|
||||
|
@ -40,6 +40,8 @@ require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
|
||||
// Allow CORS requests.
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Headers: range');
|
||||
header('Access-Control-Expose-Headers: Content-Range');
|
||||
|
||||
// Authenticate the user.
|
||||
$token = required_param('token', PARAM_ALPHANUM);
|
||||
|
Loading…
x
Reference in New Issue
Block a user