Accept varying background image filenames

main
Bob Mottram 2020-01-19 23:11:36 +00:00
parent 59f0663898
commit 86de874ac0
1 changed files with 3 additions and 5 deletions

View File

@ -1355,11 +1355,9 @@ class PubServer(BaseHTTPRequestHandler):
avatarFile=avatarStr.split('/')[1]
# remove any numbers, eg. avatar123.png becomes avatar.png
if avatarFile.startswith('avatar'):
if avatarFile.endswith('.png') or \
avatarFile.endswith('.jpg') or \
avatarFile.endswith('.gif') or \
avatarFile.endswith('.webp'):
avatarFile='avatar.'+avatarFile.split('.')[1]
avatarFile='avatar.'+avatarFile.split('.')[1]
elif avatarFile.startswith('image'):
avatarFile='image.'+avatarFile.split('.')[1]
avatarFilename= \
self.server.baseDir+'/accounts/'+ \
avatarNickname+'@'+ \