From 02ff3012c760f26e6f9c018f3ff500d3ab0d033c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 5 Sep 2019 16:07:58 +0100 Subject: [PATCH] Handle search path for following --- daemon.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index fa738c34..9df8f01b 100644 --- a/daemon.py +++ b/daemon.py @@ -1841,13 +1841,16 @@ class PubServer(BaseHTTPRequestHandler): authorized,followsPerPage) if following: if self._requestHTTP(): - if 'page=' not in self.path: + if '?page=' not in self.path: + searchPath=self.path # get a page of following, not the summary following=getFollowingFeed(self.server.baseDir,self.server.domain, \ self.server.port,self.path+'?page=true', \ self.server.httpPrefix, \ authorized,followsPerPage) - getPerson = personLookup(self.server.domain,self.path.replace('/following',''), \ + else: + searchPath=self.path.split('?page=')[0] + getPerson = personLookup(self.server.domain,searchPath.replace('/following',''), \ self.server.baseDir) if getPerson: if not self.server.session: @@ -1882,13 +1885,16 @@ class PubServer(BaseHTTPRequestHandler): authorized,followsPerPage,'followers') if followers: if self._requestHTTP(): - if 'page=' not in self.path: + if '?page=' not in self.path: + searchPath=self.path # get a page of followers, not the summary followers=getFollowingFeed(self.server.baseDir,self.server.domain, \ self.server.port,self.path+'?page=1', \ self.server.httpPrefix, \ authorized,followsPerPage,'followers') - getPerson = personLookup(self.server.domain,self.path.replace('/followers',''), \ + else: + searchPath=self.path.split('?page=')[0] + getPerson = personLookup(self.server.domain,searchPath.replace('/followers',''), \ self.server.baseDir) if getPerson: if not self.server.session: