Enhance API functionality and security: Added rate limiting and domain validation across multiple API endpoints, improved error handling for missing or invalid parameters, and refactored email handling in contact form for better security and maintainability. Updated README.md with production build instructions and prerequisites.
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* HexaDNS - Reverse DNS Lookup API
|
||||
*
|
||||
*
|
||||
* Löst eine IP-Adresse zu einem Hostnamen auf
|
||||
*
|
||||
*
|
||||
* Verwendung: GET /api/reverse-dns.php?ip=8.8.8.8
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../includes/api-helpers.php';
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, OPTIONS');
|
||||
@@ -17,6 +19,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!checkApiRateLimit('reverse-dns')) {
|
||||
rejectApiRateLimit();
|
||||
}
|
||||
|
||||
$ip = isset($_GET['ip']) ? trim($_GET['ip']) : '';
|
||||
|
||||
if (empty($ip)) {
|
||||
|
||||
Reference in New Issue
Block a user