More API improvements
This commit is contained in:
parent
da564cc43f
commit
4af16f2e52
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue