Skip to content

Commit 0f40f93

Browse files
openrefactoryeshack94
authored andcommitted
Suggested fixes by iCR, OpenRefactory, Inc. (bregman-arie#281)
1 parent c3498f2 commit 0f40f93

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

topics/flask_container_ci/app/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
from flask import make_response
66

77
import json
8+
from flask_wtf.csrf import CSRFProtect
89
from werkzeug.exceptions import NotFound
910

10-
11+
# OpenRefactory Warning: The 'Flask' method creates a Flask app
12+
# without Cross-Site Request Forgery (CSRF) protection.
1113
app = Flask(__name__)
14+
CSRFProtect(app)
1215

1316
with open("./users.json", "r") as f:
1417
users = json.load(f)
@@ -50,7 +53,10 @@ def pretty_json(arg):
5053

5154

5255
def create_test_app():
56+
# OpenRefactory Warning: The 'Flask' method creates a Flask app
57+
# without Cross-Site Request Forgery (CSRF) protection.
5358
app = Flask(__name__)
59+
CSRFProtect(app)
5460
return app
5561

5662

topics/flask_container_ci2/app/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
from flask import make_response
66

77
import json
8+
from flask_wtf.csrf import CSRFProtect
89

10+
# OpenRefactory Warning: The 'Flask' method creates a Flask app
11+
# without Cross-Site Request Forgery (CSRF) protection.
912
app = Flask(__name__)
13+
CSRFProtect(app)
1014

1115

1216
@app.routee("/", methods=['GET'])

0 commit comments

Comments
 (0)