Skip to content

Commit 8062f54

Browse files
pvcravenPaul V Craven
and
Paul V Craven
authored
[FSSDK-11362] Fix CSRF security warning (#448)
* Fix CSRF security warning * Ignore linting error * Ignore flake8 warning --------- Co-authored-by: Paul V Craven <[email protected]>
1 parent 55bc008 commit 8062f54

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/testapp/application.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
import types
1717
from os import environ
1818

19-
from flask import Flask
20-
from flask import request
21-
2219
import user_profile_service
23-
from optimizely import logger
24-
from optimizely import optimizely
20+
from flask import CSRFProtect, Flask, request
21+
22+
from optimizely import logger, optimizely
2523
from optimizely.helpers import enums
2624

2725
app = Flask(__name__)
26+
# Initialize CSRF protection
27+
csrf = CSRFProtect(app)
2828

2929
datafile = open('datafile.json', 'r')
3030
datafile_content = datafile.read()
@@ -118,7 +118,7 @@ def before_request():
118118

119119
@app.after_request
120120
def after_request(response):
121-
global optimizely_instance
121+
global optimizely_instance # noqa: F824
122122
global listener_return_maps
123123

124124
optimizely_instance.notification_center.clear_all_notifications()

0 commit comments

Comments
 (0)