Convert json to string

merge-requests/3/merge
Bob Mottram 2019-11-13 10:59:17 +00:00
parent 437f07f95a
commit 4ab26f0378
1 changed files with 3 additions and 3 deletions

View File

@ -334,8 +334,8 @@ class PubServer(BaseHTTPRequestHandler):
print('DEBUG: WEBFINGER nodeinfo')
info=metaDataNodeInfo(self.server.registration,self.server.projectVersion)
if info:
msg=info.encode('utf-8')
self._set_headers('application/ld+json',len(msg),None)
msg=json.dumps(info).encode('utf-8')
self._set_headers('application/json',len(msg),None)
self._write(msg)
return True
@ -357,7 +357,7 @@ class PubServer(BaseHTTPRequestHandler):
if self.path.startswith('/.well-known/nodeinfo'):
wfResult=webfingerNodeInfo(self.server.httpPrefix,self.server.domainFull)
if wfResult:
msg=wfResult.encode('utf-8')
msg=json.dumps(wfResult).encode('utf-8')
self._set_headers('application/json',len(msg),None)
self._write(msg)
return True