X-Git-Url: https://git.cweiske.de/stouyapi.git/blobdiff_plain/4d2b9288d5403294fe6541358341986910e43c36..f426e1fda0d54aef2ea4b1efcaf4f579dc319e02:/www/api/v1/queued_downloads_delete.php diff --git a/www/api/v1/queued_downloads_delete.php b/www/api/v1/queued_downloads_delete.php index 3861f93..6517adc 100644 --- a/www/api/v1/queued_downloads_delete.php +++ b/www/api/v1/queued_downloads_delete.php @@ -12,15 +12,16 @@ $apiGameDir = __DIR__ . '/details-data/'; require_once __DIR__ . '/../../../src/push-to-my-ouya-helpers.php'; $ip = $_SERVER['REMOTE_ADDR']; -if ($ip == '' || strpos($ip, ':') !== false) { - //empty or IPv6 +if ($ip == '') { + //empty ip + header('X-Fail-Reason: empty ip address'); header('HTTP/1.0 204 No Content'); exit(1); } $ip = mapIp($ip); $game = $_GET['game']; -$cleanGame = preg_replace('#[^a-zA-Z0-9.]#', '', $game); +$cleanGame = preg_replace('#[^a-zA-Z0-9._]#', '', $game); if ($game != $cleanGame || $game == '') { header('HTTP/1.0 400 Bad Request'); header('Content-type: text/plain'); @@ -32,6 +33,7 @@ try { $db = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE); } catch (Exception $e) { //db file not found + header('X-Fail-Reason: database file not found'); header('HTTP/1.0 204 No Content'); exit(1); }