From c62a190a7917ba6a33afc5f2c8e34bb9b3588b07 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 12 Oct 2020 14:17:38 +0100 Subject: [PATCH] Earlier condition --- daemon.py | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/daemon.py b/daemon.py index 6c713666..955bd361 100644 --- a/daemon.py +++ b/daemon.py @@ -9083,6 +9083,33 @@ class PubServer(BaseHTTPRequestHandler): 'permitted directory', 'login shown done') + print('TEST1 ' + self.path) + if authorized and htmlGET and '/users/' in self.path and \ + self.path.endswith('/newswiremobile'): + print('TEST2 ' + self.path) + nickname = getNicknameFromActor(self.path) + if not nickname: + self._404() + self.server.GETbusy = False + return + print('TEST3 ' + nickname) + timelinePath = \ + '/users/' + nickname + '/' + self.server.defaultTimeline + print('TEST4 ' + timelinePath) + msg = htmlNewswireMobile(self.server.baseDir, + nickname, + self.server.domain, + self.server.domainFull, + self.server.httpPrefix, + self.server.translate, + self.server.newswire, + self.server.positiveVoting, + timelinePath) + self._set_headers('text/html', len(msg), cookie, callingDomain) + self._write(msg) + self.server.GETbusy = False + return + # hashtag search if self.path.startswith('/tags/') or \ (authorized and '/tags/' in self.path): @@ -9153,33 +9180,6 @@ class PubServer(BaseHTTPRequestHandler): 'search screen shown') return - if htmlGET and '/users/' in self.path: - print('TEST1 ' + self.path) - if self.path.endswith('/newswiremobile'): - print('TEST2 ' + self.path) - nickname = getNicknameFromActor(self.path) - if not nickname: - self._404() - self.server.GETbusy = False - return - print('TEST3 ' + nickname) - timelinePath = \ - '/users/' + nickname + '/' + self.server.defaultTimeline - print('TEST4 ' + timelinePath) - msg = htmlNewswireMobile(self.server.baseDir, - nickname, - self.server.domain, - self.server.domainFull, - self.server.httpPrefix, - self.server.translate, - self.server.newswire, - self.server.positiveVoting, - timelinePath) - self._set_headers('text/html', len(msg), cookie, callingDomain) - self._write(msg) - self.server.GETbusy = False - return - self._benchmarkGETtimings(GETstartTime, GETtimings, 'hashtag search done', 'search screen shown done')