MDL-59473 request: Fix Loop Redirection in Oauth2

Conflicts:
	lib/oauthlib.php
This commit is contained in:
Sebastian Tabares Amaya
2017-07-07 09:12:11 -05:00
parent 0581a9be05
commit 21f36301a6
+7
View File
@@ -510,6 +510,10 @@ abstract class oauth2_client extends curl {
$r = json_decode($response);
if (is_null($r)) {
throw new moodle_exception("Could not decode JSON token response");
}
if (!isset($r->access_token)) {
return false;
}
@@ -552,6 +556,9 @@ abstract class oauth2_client extends curl {
}
}
// Force JSON format content in response.
$this->setHeader('Accept: application/json');
return parent::request($murl->out(false), $options);
}