update
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user