mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
0e474769d4
commit
0d96aaacb7
18
daemon.py
18
daemon.py
|
@ -174,6 +174,14 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
return True
|
||||
return False
|
||||
|
||||
def _isAuthorized(self) -> bool:
|
||||
if self.headers.get('Authorization'):
|
||||
if authorize(self.server.baseDir,self.path, \
|
||||
self.headers['Authorization'], \
|
||||
self.server.debug):
|
||||
return True
|
||||
return False
|
||||
|
||||
def do_GET(self):
|
||||
if self.server.debug:
|
||||
print('DEBUG: GET from '+self.server.baseDir+ \
|
||||
|
@ -257,10 +265,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
# get the inbox for a given person
|
||||
if self.path.endswith('/inbox'):
|
||||
if '/users/' in self.path:
|
||||
if self.headers.get('Authorization'):
|
||||
if authorize(self.server.baseDir,self.path, \
|
||||
self.headers['Authorization'], \
|
||||
self.server.debug):
|
||||
if self._isAuthorized():
|
||||
inboxFeed=personBoxJson(self.server.baseDir, \
|
||||
self.server.domain, \
|
||||
self.server.port, \
|
||||
|
@ -380,10 +385,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
if self.path.endswith('/outbox'):
|
||||
if '/users/' in self.path:
|
||||
if self.headers.get('Authorization'):
|
||||
if authorize(self.server.baseDir,self.path, \
|
||||
self.headers['Authorization'], \
|
||||
self.server.debug):
|
||||
if self._isAuthorized():
|
||||
self.outboxAuthenticated=True
|
||||
pathUsersSection=path.split('/users/')[1]
|
||||
self.postToNickname=pathUsersSection.split('/')[0]
|
||||
|
|
Loading…
Reference in New Issue