diff --git a/webapp/api.php b/webapp/api.php index a3f861a..9bdfd36 100644 --- a/webapp/api.php +++ b/webapp/api.php @@ -2247,16 +2247,7 @@ function handleAwsSettingsSave($db) { * Test AWS connection */ function handleAwsTest($db) { - if ($_SERVER['REQUEST_METHOD'] !== 'POST') { - jsonResponse(['error' => 'Method not allowed'], 405); - } - - $input = json_decode(file_get_contents('php://input'), true); - - if (!validateCSRFToken($input['csrf_token'] ?? '')) { - jsonResponse(['error' => 'Invalid CSRF token'], 403); - } - + // Allow both GET and POST for testing connection $accessKeyId = getSetting($db, 'aws_access_key_id', ''); $secretAccessKey = getSetting($db, 'aws_secret_access_key', ''); $region = getSetting($db, 'aws_region', 'us-east-1'); @@ -2280,6 +2271,7 @@ function handleAwsTest($db) { jsonResponse([ 'success' => true, + 'zones_count' => $zoneCount, 'message' => "Connection successful! Found {$zoneCount} hosted zone(s)." ]); } catch (Exception $e) {