From 4af16f2e5298624afa5b64520f2fb47358252340 Mon Sep 17 00:00:00 2001 From: Bofh Date: Thu, 11 Feb 2021 20:16:27 +0100 Subject: [PATCH] More API improvements --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index ab25251..5a20f01 100644 --- a/server.py +++ b/server.py @@ -25,14 +25,15 @@ class MyServer(BaseHTTPRequestHandler): accounts = os.listdir('./db/accounts') for acc in sorted(set(accounts)): echo(self, acc) + return 0 # lists accounts on a pretty HTML + CSS # making sure there is no XSS possible on account names elif action == 'mirrors': html = igmirror.pixelfed_htmlfill_mirrors( igmirror.template('mirrors') ) - echo(self, html) + return echo(self, html) - return + return echo(self, {'status': 'error', 'message': '1st parameter action not defined: {}'.format(action)}) if len(parts) == 2: response(self, 200, 'json')