Bug fix for no referer domain on nodeinfo

main
Bob Mottram 2022-04-01 09:37:36 +01:00
parent 92f3bbb763
commit 3ec2831c71
1 changed files with 8 additions and 2 deletions

View File

@ -1332,6 +1332,9 @@ class PubServer(BaseHTTPRequestHandler):
self._400()
return True
if self.server.nodeinfo_is_active:
if not referer_domain:
print('nodeinfo is busy during request without referer domain')
else:
print('nodeinfo is busy during request from ' + referer_domain)
self._503()
return True
@ -1413,7 +1416,10 @@ class PubServer(BaseHTTPRequestHandler):
self._set_headers('application/ld+json', msglen,
None, calling_domain, True)
self._write(msg)
if referer_domain:
print('nodeinfo sent to ' + referer_domain)
else:
print('nodeinfo sent to unknown referer')
self.server.nodeinfo_is_active = False
return True
self._404()