From 0f28decf204569094843b057bcc8e8b3567633c1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 19 Jul 2019 17:11:09 +0100 Subject: [PATCH] jrd according to webfinger spec --- daemon.py | 2 +- session.py | 2 +- webfinger.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 5e500fec..89aa49ad 100644 --- a/daemon.py +++ b/daemon.py @@ -99,7 +99,7 @@ class PubServer(BaseHTTPRequestHandler): print('DEBUG: WEBFINGER lookup '+self.path+' '+str(self.server.baseDir)) wfResult=webfingerLookup(self.path,self.server.baseDir,self.server.port,self.server.debug) if wfResult: - self._set_headers('application/ld+json') + self._set_headers('application/jrd+json') self.wfile.write(json.dumps(wfResult).encode('utf-8')) else: if self.server.debug: diff --git a/session.py b/session.py index d9f3b382..5a111742 100644 --- a/session.py +++ b/session.py @@ -31,7 +31,7 @@ def getJson(session,url: str,headers: {},params: {}) -> {}: sessionHeaders=headers if params: sessionParams=params - sessionHeaders['User-agent'] = "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5 Build/LMY48B; wv)" + sessionHeaders['User-agent'] = "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5)" if not session: print('WARN: no session specified for getJson') session.cookies.clear() diff --git a/webfinger.py b/webfinger.py index a2e33cf8..5b112040 100644 --- a/webfinger.py +++ b/webfinger.py @@ -53,7 +53,7 @@ def webfingerHandle(session,handle: str,httpPrefix: str,cachedWebfingers: {}) -> return wf url = '{}://{}/.well-known/webfinger'.format(httpPrefix,domain) par = {'resource': 'acct:{}'.format(nickname+'@'+wfDomain)} - hdr = {'Accept': 'application/ld+json'} + hdr = {'Accept': 'application/jrd+json'} try: result = getJson(session, url, hdr, par) except: