mirror of https://gitlab.com/bashrc2/epicyon
Prepend image
parent
266eb1af47
commit
d1b1e18af4
|
@ -10128,7 +10128,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# The file has not changed
|
# The file has not changed
|
||||||
self._304()
|
self._304()
|
||||||
return True
|
return True
|
||||||
mediaImageType = 'png'
|
mediaImageType = 'image/png'
|
||||||
extensionsToMime = {
|
extensionsToMime = {
|
||||||
'jpg': 'jpeg',
|
'jpg': 'jpeg',
|
||||||
'gif': 'gif',
|
'gif': 'gif',
|
||||||
|
@ -10138,12 +10138,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
}
|
}
|
||||||
for ext, mimeExt in extensionsToMime.items():
|
for ext, mimeExt in extensionsToMime.items():
|
||||||
if avatarFile.endswith('.' + ext):
|
if avatarFile.endswith('.' + ext):
|
||||||
mediaImageType = mimeExt
|
mediaImageType = 'image/' + mimeExt
|
||||||
break
|
break
|
||||||
with open(avatarFilename, 'rb') as avFile:
|
with open(avatarFilename, 'rb') as avFile:
|
||||||
mediaBinary = avFile.read()
|
mediaBinary = avFile.read()
|
||||||
self._set_headers_etag(avatarFilename,
|
self._set_headers_etag(avatarFilename,
|
||||||
'image/' + mediaImageType,
|
mediaImageType,
|
||||||
mediaBinary, None,
|
mediaBinary, None,
|
||||||
self.server.domainFull)
|
self.server.domainFull)
|
||||||
self._write(mediaBinary)
|
self._write(mediaBinary)
|
||||||
|
|
Loading…
Reference in New Issue