Prioritize nodeinfo

main
Bob Mottram 2019-11-15 13:17:28 +00:00
parent 2f5c061168
commit 6b4a23bcd3
1 changed files with 9 additions and 8 deletions

View File

@ -816,6 +816,15 @@ class PubServer(BaseHTTPRequestHandler):
self.end_headers() self.end_headers()
def do_GET(self): def do_GET(self):
# Since fediverse crawlers are quite active, make returning info to them high priority
# get nodeinfo endpoint
if self._nodeinfo():
return
# minimal mastodon api
if self._mastoApi():
return
if self.path=='/logout': if self.path=='/logout':
msg=htmlLogin(self.server.translate, \ msg=htmlLogin(self.server.translate, \
self.server.baseDir,False).encode('utf-8') self.server.baseDir,False).encode('utf-8')
@ -1259,14 +1268,6 @@ class PubServer(BaseHTTPRequestHandler):
if self._webfinger(): if self._webfinger():
self.server.GETbusy=False self.server.GETbusy=False
return return
# get nodeinfo endpoint
if self._nodeinfo():
self.server.GETbusy=False
return
# minimal mastodon api
if self._mastoApi():
self.server.GETbusy=False
return
if self.path.startswith('/login') or \ if self.path.startswith('/login') or \
(self.path=='/' and not authorized): (self.path=='/' and not authorized):