Only store webfinger in cache if returned

main
Bob Mottram 2020-05-07 14:21:58 +01:00
parent 0f1ad061ec
commit 959c1080c7
3 changed files with 10 additions and 9 deletions

View File

@ -6004,7 +6004,6 @@ class PubServer(BaseHTTPRequestHandler):
searchStr = searchStr.replace('+', ' ')
searchStr = \
urllib.parse.unquote(searchStr.strip())
if self.server.debug:
print('searchStr: ' + searchStr)
if searchForEmoji:
searchStr = ':' + searchStr + ':'

View File

@ -44,6 +44,8 @@ def parseHandle(handle: str) -> (str, str):
def webfingerHandle(session, handle: str, httpPrefix: str,
cachedWebfingers: {},
fromDomain: str, projectVersion: str) -> {}:
"""
"""
if not session:
print('WARN: No session specified for webfingerHandle')
return None
@ -81,6 +83,8 @@ def webfingerHandle(session, handle: str, httpPrefix: str,
print('params: ' + str(par))
print(e)
return None
if result:
storeWebfingerInCache(nickname + '@' + wfDomain,
result, cachedWebfingers)
return result

View File

@ -5846,7 +5846,6 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
httpPrefix, wfRequest,
domain, projectVersion)
if not wf:
if debug:
print('DEBUG: Unable to webfinger ' +
searchNickname + '@' + searchDomainFull)
return None
@ -5878,7 +5877,6 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
getJson(session, personUrl, asHeader, None,
projectVersion, httpPrefix, domain)
if not profileJson:
if debug:
print('DEBUG: No actor returned from ' + personUrl)
return None
avatarUrl = ''