refactor: address validation review feedback

Agent-Logs-Url: https://github.com/Stalin-143/Keylogger/sessions/cef34b0e-605b-4ab9-8da6-2559d1dd4529

Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-19 04:44:43 +00:00
committed by GitHub
parent e450630b7d
commit d61ff1364e
2 changed files with 6 additions and 5 deletions
+6 -2
View File
@@ -227,8 +227,12 @@ def main():
print("Please set server_url in config/config.json or use --server-url argument.") print("Please set server_url in config/config.json or use --server-url argument.")
sys.exit(1) sys.exit(1)
if not api_key or len(api_key) < 24: if not api_key:
print("Error: LOG_INGEST_API_KEY environment variable is required and must be at least 24 characters.") print("Error: LOG_INGEST_API_KEY environment variable is required.")
sys.exit(1)
if len(api_key) < 24:
print("Error: LOG_INGEST_API_KEY must be at least 24 characters.")
sys.exit(1) sys.exit(1)
if args.no_verify_ssl: if args.no_verify_ssl:
-3
View File
@@ -230,9 +230,6 @@ def receive_log():
if not has_valid_api_key(): if not has_valid_api_key():
return "Unauthorized", 401 return "Unauthorized", 401
if request.content_length and request.content_length > MAX_LOG_PAYLOAD_BYTES:
return "Log payload too large", 413
log_data = request.form.get('log', '') log_data = request.form.get('log', '')
if log_data: if log_data:
if len(log_data.encode('utf-8')) > MAX_LOG_PAYLOAD_BYTES: if len(log_data.encode('utf-8')) > MAX_LOG_PAYLOAD_BYTES: