Outbox post authorization is on particular nicknames

master
Bob Mottram 2019-07-03 21:03:38 +01:00
parent f2c596ee2d
commit 503c423a18
1 changed files with 12 additions and 9 deletions

View File

@ -226,15 +226,18 @@ class PubServer(BaseHTTPRequestHandler):
self.server.POSTbusy=False self.server.POSTbusy=False
return return
if self.path=='/outbox': if self.path.endswith('/outbox'):
if self.headers.get('Authorization'): if '/users/' in self.path:
if authorize(self.server.baseDir,self.headers['Authorization']): if self.headers.get('Authorization'):
# TODO nickname=self.path.split('/users/')[1].replace('/inbox','')
print('c2s posts not supported yet') if nickname==nicknameFromBasicAuth(self.headers['Authorization']):
self.send_response(401) if authorize(self.server.baseDir,self.headers['Authorization']):
self.end_headers() # TODO
self.server.POSTbusy=False print('c2s posts not supported yet')
return self.send_response(401)
self.end_headers()
self.server.POSTbusy=False
return
self.send_response(401) self.send_response(401)
self.end_headers() self.end_headers()
self.server.POSTbusy=False self.server.POSTbusy=False