Protocol header for nodeinfo

main
Bob Mottram 2023-09-17 11:10:40 +01:00
parent 7dc4a7624e
commit a3df7759f4
1 changed files with 5 additions and 8 deletions

View File

@ -1644,14 +1644,11 @@ class PubServer(BaseHTTPRequestHandler):
msg_str)
msg = msg_str.encode('utf-8')
msglen = len(msg)
if self._has_accept(calling_domain):
protocol_str = \
get_json_content_from_accept(self.headers.get('Accept'))
'application/json; profile=' + \
'"http://nodeinfo.diaspora.software/ns/schema/2.1#"'
self._set_headers(protocol_str, msglen,
None, calling_domain, True)
else:
self._set_headers('application/ld+json', msglen,
None, calling_domain, True)
self._write(msg)
if referer_domain:
print('nodeinfo sent to ' + referer_domain)