mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 04:12:25 +00:00
Merge pull request #2337 from PR0M3TH3AN/fix/security-remove-unsafe-logging-997674150393261615
🔒 Remove vulnerable unused logging function
This commit is contained in:
1 file changed
-18
@@ -297,24 +297,6 @@ const EVENTS_CACHE_DB_VERSION = 1;
|
||||
const DEFAULT_VIDEO_REQUEST_LIMIT = 150;
|
||||
const MAX_VIDEO_REQUEST_LIMIT = 500;
|
||||
|
||||
// To limit error spam
|
||||
let errorLogCount = 0;
|
||||
const MAX_ERROR_LOGS = 100;
|
||||
function logErrorOnce(message, eventContent = null) {
|
||||
if (errorLogCount < MAX_ERROR_LOGS) {
|
||||
userLogger.error(message);
|
||||
if (eventContent) {
|
||||
devLogger.log(`Event Content: ${eventContent}`);
|
||||
}
|
||||
errorLogCount++;
|
||||
}
|
||||
if (errorLogCount === MAX_ERROR_LOGS) {
|
||||
userLogger.error(
|
||||
"Maximum error log limit reached. Further errors will be suppressed."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const __testExports = {
|
||||
runNip07WithRetry,
|
||||
DEFAULT_NIP07_ENCRYPTION_METHODS,
|
||||
|
||||
Reference in new issue
Block a user