From 56a223f863cf20ab2117c87495223001b8c12119 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 29 May 2020 20:37:33 +0100 Subject: [PATCH] Debug --- daemon.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 2d4f4108a..bea38e5ce 100644 --- a/daemon.py +++ b/daemon.py @@ -1107,10 +1107,13 @@ class PubServer(BaseHTTPRequestHandler): # favicon image if 'favicon.ico' in self.path: + favType = 'image/x-icon' favFilename = 'favicon.ico' if self.headers.get('Accept'): if 'image/webp' in self.headers['Accept']: + favType = 'image/webp' favFilename = 'favicon.webp' + print('Sending webp favicon') # custom favicon faviconFilename = \ self.server.baseDir + '/' + favFilename @@ -1118,28 +1121,33 @@ class PubServer(BaseHTTPRequestHandler): # default favicon faviconFilename = \ self.server.baseDir + '/img/icons/' + favFilename + print('faviconFilename: ' + faviconFilename) if self._etag_exists(faviconFilename): # The file has not changed self._304() return if self.server.iconsCache.get(favFilename): + print('Get favicon from cache') favBinary = self.server.iconsCache[favFilename] self._set_headers_etag(faviconFilename, - 'image/x-icon', + favType, favBinary, cookie, callingDomain) self._write(favBinary) return else: + print('Get favicon from file') if os.path.isfile(faviconFilename): + print('favicon file found') with open(faviconFilename, 'rb') as favFile: favBinary = favFile.read() self._set_headers_etag(faviconFilename, - 'image/x-icon', + favType, favBinary, cookie, callingDomain) self._write(favBinary) self.server.iconsCache[favFilename] = favBinary + print('favicon file send') return self._404() return