Skip to content

Commit ab8cee2

Browse files
authored
Merge pull request #3 from ne0ekspert/alert-autofix-3
Fix code scanning alert no. 3: Flask app is run in debug mode
2 parents 37a9017 + 357b0f2 commit ab8cee2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nfcapi.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ def start_nfc_reader():
4545
poll_nfc_thread.daemon = True # Allow thread to exit when the program exits
4646
poll_nfc_thread.start()
4747

48+
import os
49+
4850
if __name__ == '__main__':
4951
start_nfc_reader()
50-
app.run(debug=True, host='0.0.0.0', port=5000)
52+
debug_mode = os.getenv('FLASK_DEBUG', 'False').lower() in ['true', '1', 't']
53+
app.run(debug=debug_mode, host='0.0.0.0', port=5000)

0 commit comments

Comments
 (0)