From 9bc310a6a47b7a71af8391deb3d37e23b788a463 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 22 May 2022 19:23:52 +0200 Subject: [PATCH] sfd --- files/routes/static.py | 4 ++++ files/routes/users.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/files/routes/static.py b/files/routes/static.py index 6a0a9cbd7..b9ca1454a 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -441,6 +441,7 @@ def archives(path): return resp @app.get('/e/') +@limiter.exempt def emoji(emoji): if not emoji.endswith('.webp'): abort(404) resp = make_response(send_from_directory('assets/images/emojis', emoji)) @@ -452,6 +453,7 @@ def emoji(emoji): @app.get('/assets/') @app.get('/static/assets/') +@limiter.exempt def static_service(path): resp = make_response(send_from_directory('assets', path)) if request.path.endswith('.webp') or request.path.endswith('.gif') or request.path.endswith('.ttf') or request.path.endswith('.woff2'): @@ -467,6 +469,7 @@ def static_service(path): @app.get('/images/') @app.get('/hostedimages/') @app.get("/static/images/") +@limiter.exempt def images(path): resp = make_response(send_from_directory('/images', path.replace('.WEBP','.webp'))) resp.headers.remove("Cache-Control") @@ -476,6 +479,7 @@ def images(path): return resp @app.get('/videos/') +@limiter.exempt def videos(path): resp = make_response(send_from_directory('/videos', path.replace('.MP4','.mp4'))) resp.headers.remove("Cache-Control") diff --git a/files/routes/users.py b/files/routes/users.py index 69a214ef9..3e452d76b 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1141,6 +1141,7 @@ def remove_follow(username, v): @app.get("/logged_out/pp/") @app.get("/logged_out/uid//pic") @app.get("/logged_out/uid//pic/profile") +@limiter.exempt @auth_desired def user_profile_uid(v, id): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") @@ -1155,6 +1156,7 @@ def user_profile_uid(v, id): return redirect(x.profile_url) @app.get("/@/pic") +@limiter.exempt @auth_required def user_profile_name(v, username): x = get_user(username)