-
Bug
-
Resolution: Fixed
-
Critical
-
2.3.8, 2.4.4, 2.5.1
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
MDL-40005_lti_headers -
Steps to reproduce:
Run PHP as FCGI
Try to POST a grade from an external tool to Moodle
Nothing is reported
This is due to the fact that getheaders() used in service.php only works when mod_php is used via Apache.
My solution was to use a .htaccess with this in it:
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%
,L]
And insert the following code at the very top of the page
if (!function_exists('getallheaders'))
{
function getallheaders()
{
$headers = '';
foreach ($_SERVER as $name => $value)
{
if (substr($name, 0, 5) == 'HTTP_')
}
$headers['Authorization'] = $_SERVER['HTTP_AUTHORIZATION'];
return $headers;
}
}
- duplicates
-
MDL-32352 Use of getallheaders() causes problems with outcomes feature of external tools when working on IIS
-
- Closed
-