mirror of https://gitlab.com/bashrc2/epicyon
Return 404 is path doesn't match
parent
6b4a23bcd3
commit
f84c800cb1
|
@ -394,7 +394,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
print('instance activity metadata sent')
|
print('instance activity metadata sent')
|
||||||
return True
|
return True
|
||||||
return False
|
self._404()
|
||||||
|
return True
|
||||||
|
|
||||||
def _nodeinfo(self) -> bool:
|
def _nodeinfo(self) -> bool:
|
||||||
if not self.path.startswith('/nodeinfo/2.0'):
|
if not self.path.startswith('/nodeinfo/2.0'):
|
||||||
|
@ -414,6 +415,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
print('nodeinfo sent')
|
print('nodeinfo sent')
|
||||||
return True
|
return True
|
||||||
|
self._404()
|
||||||
|
return True
|
||||||
|
|
||||||
def _webfinger(self) -> bool:
|
def _webfinger(self) -> bool:
|
||||||
if not self.path.startswith('/.well-known'):
|
if not self.path.startswith('/.well-known'):
|
||||||
|
@ -430,6 +433,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._set_headers('application/xrd+xml',len(msg),None)
|
self._set_headers('application/xrd+xml',len(msg),None)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
return True
|
return True
|
||||||
|
self._404()
|
||||||
|
return True
|
||||||
if self.path.startswith('/.well-known/nodeinfo'):
|
if self.path.startswith('/.well-known/nodeinfo'):
|
||||||
wfResult=webfingerNodeInfo(self.server.httpPrefix,self.server.domainFull)
|
wfResult=webfingerNodeInfo(self.server.httpPrefix,self.server.domainFull)
|
||||||
if wfResult:
|
if wfResult:
|
||||||
|
@ -443,6 +448,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._set_headers('application/ld+json',len(msg),None)
|
self._set_headers('application/ld+json',len(msg),None)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
return True
|
return True
|
||||||
|
self._404()
|
||||||
|
return True
|
||||||
|
|
||||||
if self.server.debug:
|
if self.server.debug:
|
||||||
print('DEBUG: WEBFINGER lookup '+self.path+' '+str(self.server.baseDir))
|
print('DEBUG: WEBFINGER lookup '+self.path+' '+str(self.server.baseDir))
|
||||||
|
|
Loading…
Reference in New Issue