From 6c8faf6de79b1ae30f21e4ee577ead698001f84c Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 28 Sep 2022 01:14:40 -0700 Subject: [PATCH] add API version of stats page (#378) statsmaxxing --- files/routes/static.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index 06dfc8ef6..05d8bea1e 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -79,6 +79,7 @@ def sidebar(v): @app.get("/stats") @auth_required def participation_stats(v): + if request.headers.get("Authorization"): return stats_cached() return render_template("stats.html", v=v, title="Content Statistics", data=stats_cached()) @cache.memoize(timeout=86400) @@ -609,4 +610,4 @@ if SITE == 'pcmemes.net': if live: cache.set('live', live) if offline: cache.set('offline', offline) - return redirect('/live') \ No newline at end of file + return redirect('/live')