Browse Source

Gent nickname from path

merge-requests/20/merge
Bob Mottram 1 month ago
parent
commit
79b80e1767
2 changed files with 6 additions and 6 deletions
  1. 5
    4
      daemon.py
  2. 1
    2
      webapp_search.py

+ 5
- 4
daemon.py View File

@@ -5971,10 +5971,11 @@ class PubServer(BaseHTTPRequestHandler):
5971 5971
             return
5972 5972
         nickname = None
5973 5973
         if '/users/' in path:
5974
-            actor = \
5975
-                httpPrefix + '://' + domainFull + path
5976
-            nickname = \
5977
-                getNicknameFromActor(actor)
5974
+            nickname = path.split('/users/')[1]
5975
+            if '/' in nickname:
5976
+                nickname = nickname.split('/')[0]
5977
+            if '?' in nickname:
5978
+                nickname = nickname.split('?')[0]
5978 5979
         hashtagStr = \
5979 5980
             htmlHashtagSearch(self.server.cssCache,
5980 5981
                               nickname, domain, port,

+ 1
- 2
webapp_search.py View File

@@ -648,8 +648,7 @@ def htmlHashtagSearch(cssCache: {},
648 648
 
649 649
     # check that the directory for the nickname exists
650 650
     if nickname:
651
-        if not os.path.isdir(baseDir + '/accounts/' +
652
-                             nickname + '@' + domain):
651
+        if not os.path.isdir(baseDir + '/accounts/' + nickname + '@' + domain):
653 652
             nickname = None
654 653
 
655 654
     # read the index

Loading…
Cancel
Save