From e8c76ab651df08a7456449cb12e0c2a12888b034 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 29 May 2020 20:19:26 +0100 Subject: [PATCH] Tidying --- daemon.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon.py b/daemon.py index a0be1ef8d..be68e5ce4 100644 --- a/daemon.py +++ b/daemon.py @@ -1144,19 +1144,20 @@ class PubServer(BaseHTTPRequestHandler): # favicon image if 'favicon.ico' in self.path: + favFilename = 'favicon.ico' # custom favicon faviconFilename = \ - self.server.baseDir + '/favicon.ico' + self.server.baseDir + '/' + favFilename if not os.path.isfile(faviconFilename): # default favicon faviconFilename = \ - self.server.baseDir + '/img/icons/favicon.ico' + self.server.baseDir + '/img/icons/' + favFilename if self._etag_exists(faviconFilename): # The file has not changed self._304() return - if self.server.iconsCache.get('favicon.ico'): - favBinary = self.server.iconsCache['favicon.ico'] + if self.server.iconsCache.get(favFilename): + favBinary = self.server.iconsCache[favFilename] self._set_headers_etag(faviconFilename, 'image/x-icon', favBinary, cookie, @@ -1172,7 +1173,7 @@ class PubServer(BaseHTTPRequestHandler): favBinary, cookie, callingDomain) self._write(favBinary) - self.server.iconsCache['favicon.ico'] = favBinary + self.server.iconsCache[favFilename] = favBinary return self._404() return