Get nickname for search banner

main
Bob Mottram 2020-06-10 14:05:47 +01:00
parent 9223da4284
commit c6a925e9e4
1 changed files with 5 additions and 2 deletions

View File

@ -1727,9 +1727,12 @@ class PubServer(BaseHTTPRequestHandler):
return
# search screen banner image
if self.path == '/search_banner.png':
if '/users/' in self.path and \
self.path.endswith('/search_banner.png'):
nickname = getNicknameFromActor(self.path)
mediaFilename = \
self.server.baseDir + '/accounts/search_banner.png'
self.server.baseDir + '/accounts/' + \
nickname + '@' + self.server.domain + '/search_banner.png'
if os.path.isfile(mediaFilename):
if self._etag_exists(mediaFilename):
# The file has not changed