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')