From 39f64ca6667a0e8703a7a52d6e2bf0da57ee2cb6 Mon Sep 17 00:00:00 2001 From: marios8543 Date: Tue, 17 Oct 2023 16:07:43 +0300 Subject: Drop support for legacy plugins --- backend/src/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend/src/helpers.py') diff --git a/backend/src/helpers.py b/backend/src/helpers.py index f8796bd8..0acfd929 100644 --- a/backend/src/helpers.py +++ b/backend/src/helpers.py @@ -32,7 +32,7 @@ def get_csrf_token(): @middleware async def csrf_middleware(request: Request, handler: Handler): - if str(request.method) == "OPTIONS" or request.headers.get('Authentication') == csrf_token or str(request.rel_url) == "/auth/token" or str(request.rel_url).startswith("/plugins/load_main/") or str(request.rel_url).startswith("/static/") or str(request.rel_url).startswith("/legacy/") or str(request.rel_url).startswith("/steam_resource/") or str(request.rel_url).startswith("/frontend/") or assets_regex.match(str(request.rel_url)) or frontend_regex.match(str(request.rel_url)): + if str(request.method) == "OPTIONS" or request.headers.get('Authentication') == csrf_token or str(request.rel_url) == "/auth/token" or str(request.rel_url).startswith("/plugins/load_main/") or str(request.rel_url).startswith("/static/") or str(request.rel_url).startswith("/steam_resource/") or str(request.rel_url).startswith("/frontend/") or assets_regex.match(str(request.rel_url)) or frontend_regex.match(str(request.rel_url)): return await handler(request) return Response(text='Forbidden', status=403) -- cgit v1.2.3