Skip to content

[FSSDK-11362] Fix CSRF security warning #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/testapp/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
import types
from os import environ

from flask import Flask
from flask import request

import user_profile_service
from optimizely import logger
from optimizely import optimizely
from flask import CSRFProtect, Flask, request

from optimizely import logger, optimizely
from optimizely.helpers import enums

app = Flask(__name__)
# Initialize CSRF protection
csrf = CSRFProtect(app)
Copy link
Preview

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling CSRF protection in the test application may cause tests to fail if CSRF tokens are not provided. Consider updating your test configuration or request simulation to correctly handle CSRF tokens.

Copilot uses AI. Check for mistakes.


datafile = open('datafile.json', 'r')
datafile_content = datafile.read()
Expand Down Expand Up @@ -118,7 +118,7 @@ def before_request():

@app.after_request
def after_request(response):
global optimizely_instance
global optimizely_instance # noqa: F824
global listener_return_maps

optimizely_instance.notification_center.clear_all_notifications()
Expand Down