This commit is contained in:
2025-11-12 21:22:27 +01:00
parent 804a751fdf
commit 95669fd211

View File

@@ -20,7 +20,12 @@ def trigger_crawl():
} }
""" """
try: try:
data = request.get_json() or {} # Handle both JSON and empty body
try:
data = request.get_json(silent=True) or {}
except:
data = {}
max_articles = data.get('max_articles', 10) max_articles = data.get('max_articles', 10)
# Validate max_articles # Validate max_articles
@@ -154,7 +159,12 @@ def send_newsletter():
} }
""" """
try: try:
data = request.get_json() or {} # Handle both JSON and empty body
try:
data = request.get_json(silent=True) or {}
except:
data = {}
max_articles = data.get('max_articles', 10) max_articles = data.get('max_articles', 10)
# Validate max_articles # Validate max_articles