From c60dae2a889a2b854da356f8d3a9d0d8250a51c5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 29 Mar 2021 10:24:28 +0100 Subject: [PATCH] Gent nickname from path --- daemon.py | 9 +++++---- webapp_search.py | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon.py b/daemon.py index d37f5f32b..701c49a1d 100644 --- a/daemon.py +++ b/daemon.py @@ -5971,10 +5971,11 @@ class PubServer(BaseHTTPRequestHandler): return nickname = None if '/users/' in path: - actor = \ - httpPrefix + '://' + domainFull + path - nickname = \ - getNicknameFromActor(actor) + nickname = path.split('/users/')[1] + if '/' in nickname: + nickname = nickname.split('/')[0] + if '?' in nickname: + nickname = nickname.split('?')[0] hashtagStr = \ htmlHashtagSearch(self.server.cssCache, nickname, domain, port, diff --git a/webapp_search.py b/webapp_search.py index 6d982c45d..78df1b04d 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -648,8 +648,7 @@ def htmlHashtagSearch(cssCache: {}, # check that the directory for the nickname exists if nickname: - if not os.path.isdir(baseDir + '/accounts/' + - nickname + '@' + domain): + if not os.path.isdir(baseDir + '/accounts/' + nickname + '@' + domain): nickname = None # read the index