Parse nickname

main
Bob Mottram 2020-02-27 20:37:42 +00:00
parent 867be4d249
commit 971257b047
1 changed files with 26 additions and 25 deletions

View File

@ -1005,31 +1005,32 @@ class PubServer(BaseHTTPRequestHandler):
if self.path.startswith('/blog/') and self.path.endswith('/rss.xml'):
nickname=self.path.split('/blog/')[1]
if '/' not in nickname:
if not nickname.startswith('rss.'):
if os.path.isdir(self.server.baseDir+ \
'/accounts/'+nickname+ \
'@'+self.server.domain):
if not self.server.session:
self.server.session= \
createSession(self.server.useTor)
msg= \
htmlBlogPageRSS(authorized, \
self.server.session, \
self.server.baseDir, \
self.server.httpPrefix, \
self.server.translate, \
nickname, \
self.server.domain, \
self.server.port, \
maxPostsInRSSFeed,1)
if msg!=None:
msg=msg.encode()
self._set_headers('text/xml',len(msg),cookie)
self._write(msg)
return
self._404()
return
if '/' in nickname:
nickname=nickname.split('/')[0]
if not nickname.startswith('rss.'):
if os.path.isdir(self.server.baseDir+ \
'/accounts/'+nickname+ \
'@'+self.server.domain):
if not self.server.session:
self.server.session= \
createSession(self.server.useTor)
msg= \
htmlBlogPageRSS(authorized, \
self.server.session, \
self.server.baseDir, \
self.server.httpPrefix, \
self.server.translate, \
nickname, \
self.server.domain, \
self.server.port, \
maxPostsInRSSFeed,1)
if msg!=None:
msg=msg.encode()
self._set_headers('text/xml',len(msg),cookie)
self._write(msg)
return
self._404()
return
# show the main blog page
if htmlGET and (self.path=='/blog' or \