23,18 → 23,12 |
|
require_once __DIR__ . '/../ClientChallenge.class.php'; |
|
require_once __DIR__ . '/config.inc.php'; |
define('MAX_TIME', 10); // seconds |
|
if (isset($_REQUEST['action']) && ($_REQUEST['action'] === 'add_numbers')) { |
|
// Check request field "vts_validation_result" for valid response of the Challenge |
try { |
\ViaThinkSoft\RateLimitingChallenge\ClientChallenge::checkValidation(MAX_TIME, VTS_CS_SERVER_SECRET); |
} catch (\Exception $e) { |
$res = array("error" => $e->getMessage()); |
header('Content-Type:application/json'); |
die(json_encode($res)); |
} |
\ViaThinkSoft\RateLimitingChallenge\ClientChallenge::checkValidation(MAX_TIME); |
|
// Do your stuff here. Example: |
$a = $_REQUEST['a']; |