Skip to content

Commit 01bcc56

Browse files
Potential fix for code scanning alert no. 21: Flask app is run in debug mode
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 3a9b002 commit 01bcc56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/chatbot/src/chatbot_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def ask_bot():
246246

247247

248248
if __name__ == "__main__":
249-
app.run(host="0.0.0.0", port=5002, debug=True)
249+
debug_mode = os.getenv("FLASK_DEBUG", "False").lower() in ("true", "1", "yes")
250+
app.run(host="0.0.0.0", port=5002, debug=debug_mode)
250251
else:
251252
gunicorn_logger = logging.getLogger("gunicorn.error")
252253
app.logger.handlers = gunicorn_logger.handlers

0 commit comments

Comments
 (0)