1
0

Add support for JSONP RPC calls.

This commit is contained in:
Markus Birth 2018-05-02 14:17:29 +02:00
parent 72d7a0742a
commit fd2c287799
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -33,4 +33,11 @@ if (array_key_exists('action', $_REQUEST)) {
}
header("Content-type: application/javascript");
echo json_encode($response);
if (isset($_GET['callback'])) {
// JSONP
echo $_GET['callback'] . '(' . json_encode($response) . ');';
} else {
// JSON
echo json_encode($response);
}