main
Bob Mottram 2021-12-15 12:10:27 +00:00
parent 4ea34b4f8f
commit 30498f4b39
1 changed files with 11 additions and 5 deletions

View File

@ -12716,11 +12716,17 @@ class PubServer(BaseHTTPRequestHandler):
avatarFilename = \
acctDir(baseDir, avatarNickname, domain) + '/' + avatarFile
if not os.path.isfile(avatarFilename):
return False
# if self._etag_exists(avatarFilename):
# # The file has not changed
# self._304()
# return True
if avatarFileExt == 'png':
return False
avatarFile = avatarFile.replace('.' + avatarFileExt, '.png')
avatarFilename = \
acctDir(baseDir, avatarNickname, domain) + '/' + avatarFile
if not os.path.isfile(avatarFilename):
return False
if self._etag_exists(avatarFilename):
# The file has not changed
self._304()
return True
t = os.path.getmtime(avatarFilename)
lastModifiedTime = datetime.datetime.fromtimestamp(t)