forked from FWS/FWS-TEMPLATE-Website-OnePage
feat(api): remove size and rate limits from the bug report API
The API is consumed by curl/scripts that need to push full installation logs, but field truncation (150k chars) and a 25-per-hour IP cap were rejecting or silently cutting those payloads. Discord log chunks are now streamed instead of being built in memory, so oversized logs no longer blow up the notifier.
This commit is contained in:
3 files changed
+46
-49
No files matched your search
@@ -236,19 +236,6 @@ function fws_bugs_save_discord_info(PDO $pdo, int $id, string $threadId, string
|
||||
$st->execute([':t' => $threadId, ':u' => $postUrl, ':id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Nombre de signalements pour une IP sur la dernière heure (anti-flood).
|
||||
*/
|
||||
function fws_bugs_count_recent_for_ip(PDO $pdo, string $ip): int
|
||||
{
|
||||
$st = $pdo->prepare(
|
||||
"SELECT COUNT(*) FROM bug_reports
|
||||
WHERE ip = :ip AND created_at > datetime('now', '-1 hour')"
|
||||
);
|
||||
$st->execute([':ip' => $ip]);
|
||||
return (int) $st->fetchColumn();
|
||||
}
|
||||
|
||||
/**
|
||||
* IP réelle en tenant compte du proxy (X-Forwarded-For).
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user