MDL-60424 webservice: Allow CORS requests in webservice/upload.php

This will allow to upload files via Web Services using AJAX from
different domains, browser plugins, web apps, etc…
This commit is contained in:
Juan Leyva
2017-11-03 09:41:44 +01:00
parent f90fb8390b
commit 3ae3f0e2ee
+4
View File
@@ -43,6 +43,10 @@ define('NO_MOODLE_COOKIES', true);
require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/webservice/lib.php');
// Allow CORS requests.
header('Access-Control-Allow-Origin: *');
$filepath = optional_param('filepath', '/', PARAM_PATH);
$itemid = optional_param('itemid', 0, PARAM_INT);