From 5e8e73f47b586026f86d574190ea78bf3ece9297 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 19 Jul 2019 14:53:27 +0100 Subject: [PATCH] webfinger acct uses domain without port --- webfinger.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webfinger.py b/webfinger.py index fe15340e1..9fbed7258 100644 --- a/webfinger.py +++ b/webfinger.py @@ -46,6 +46,8 @@ def webfingerHandle(session,handle: str,httpPrefix: str,cachedWebfingers: {}) -> return None wfDomain=domain if ':' in wfDomain: + #wfPort=int(wfDomain.split(':')[1]) + #if wfPort==80 or wfPort==443: wfDomain=wfDomain.split(':')[0] wf=getWebfingerFromCache(nickname+'@'+wfDomain,cachedWebfingers) if wf: @@ -89,6 +91,7 @@ def createWebfingerEndpoint(nickname: str,domain: str,port: int, \ httpPrefix: str,publicKeyPem) -> {}: """Creates a webfinger endpoint for a user """ + originalDomain=domain if port!=80 and port!=443: domain=domain+':'+str(port) @@ -126,7 +129,7 @@ def createWebfingerEndpoint(nickname: str,domain: str,port: int, \ "template": httpPrefix+"://"+domain+"/authorize_interaction?uri={uri}" } ], - "subject": "acct:"+nickname+"@"+domain + "subject": "acct:"+nickname+"@"+originalDomain } return account