summaryrefslogtreecommitdiff
path: root/backend/helpers.py
diff options
context:
space:
mode:
authorAAGaming <aa@mail.catvibers.me>2022-08-26 01:18:28 -0400
committerAAGaming <aa@mail.catvibers.me>2022-08-26 01:18:28 -0400
commitd4d1c2bbabfcec3c62767e614c9d67f516938af2 (patch)
treec30a7643507ade7200eff36e9c16d0512bb1edce /backend/helpers.py
parenteffc4ab0f56119041ac6efecdbf0a782714ec783 (diff)
downloaddecky-loader-d4d1c2bbabfcec3c62767e614c9d67f516938af2.tar.gz
decky-loader-d4d1c2bbabfcec3c62767e614c9d67f516938af2.zip
basic patch notes viewer, lazy-load settings and store, build frontend as esmodule, add lazy-loaded react-markdown, backend changes to accomodate ESModule frontend
Diffstat (limited to 'backend/helpers.py')
-rw-r--r--backend/helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/helpers.py b/backend/helpers.py
index b3c8a51e..0991f446 100644
--- a/backend/helpers.py
+++ b/backend/helpers.py
@@ -18,6 +18,7 @@ user = None
group = None
assets_regex = re.compile("^/plugins/.*/assets/.*")
+frontend_regex = re.compile("^/frontend/.*")
def get_ssl_context():
return ssl_ctx
@@ -27,7 +28,7 @@ def get_csrf_token():
@middleware
async def csrf_middleware(request, 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 assets_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("/legacy/") or str(request.rel_url).startswith("/steam_resource/") 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')