main
Bob Mottram 2020-05-29 20:19:26 +01:00
parent 272a07df2b
commit e8c76ab651
1 changed files with 6 additions and 5 deletions

View File

@ -1144,19 +1144,20 @@ class PubServer(BaseHTTPRequestHandler):
# favicon image # favicon image
if 'favicon.ico' in self.path: if 'favicon.ico' in self.path:
favFilename = 'favicon.ico'
# custom favicon # custom favicon
faviconFilename = \ faviconFilename = \
self.server.baseDir + '/favicon.ico' self.server.baseDir + '/' + favFilename
if not os.path.isfile(faviconFilename): if not os.path.isfile(faviconFilename):
# default favicon # default favicon
faviconFilename = \ faviconFilename = \
self.server.baseDir + '/img/icons/favicon.ico' self.server.baseDir + '/img/icons/' + favFilename
if self._etag_exists(faviconFilename): if self._etag_exists(faviconFilename):
# The file has not changed # The file has not changed
self._304() self._304()
return return
if self.server.iconsCache.get('favicon.ico'): if self.server.iconsCache.get(favFilename):
favBinary = self.server.iconsCache['favicon.ico'] favBinary = self.server.iconsCache[favFilename]
self._set_headers_etag(faviconFilename, self._set_headers_etag(faviconFilename,
'image/x-icon', 'image/x-icon',
favBinary, cookie, favBinary, cookie,
@ -1172,7 +1173,7 @@ class PubServer(BaseHTTPRequestHandler):
favBinary, cookie, favBinary, cookie,
callingDomain) callingDomain)
self._write(favBinary) self._write(favBinary)
self.server.iconsCache['favicon.ico'] = favBinary self.server.iconsCache[favFilename] = favBinary
return return
self._404() self._404()
return return