MDL-50107 webservices: Enable CORS in login/token.php
authorJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 10 Jun 2015 08:57:09 +0000 (10:57 +0200)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 10 Jun 2015 09:33:53 +0000 (11:33 +0200)
login/token.php

index ee4d6ca..54e9be1 100644 (file)
@@ -31,6 +31,8 @@ $username = required_param('username', PARAM_USERNAME);
 $password = required_param('password', PARAM_RAW);
 $serviceshortname  = required_param('service',  PARAM_ALPHANUMEXT);
 
+// Allow CORS requests.
+header('Access-Control-Allow-Origin: *');
 echo $OUTPUT->header();
 
 if (!$CFG->enablewebservices) {