Extra debug

main
Bob Mottram 2020-08-15 11:11:02 +01:00
parent fc78164ba4
commit 2f7b2be363
1 changed files with 34 additions and 4 deletions

View File

@ -1334,6 +1334,8 @@ class PubServer(BaseHTTPRequestHandler):
len(msg),
None, callingDomain)
self._write(msg)
if self.server.debug:
print('Sent manifest: ' + callingDomain)
return
# favicon image
@ -1353,6 +1355,8 @@ class PubServer(BaseHTTPRequestHandler):
self.server.baseDir + '/img/icons/' + favFilename
if self._etag_exists(faviconFilename):
# The file has not changed
if self.server.debug:
print('favicon icon has not changed: ' + callingDomain)
self._304()
return
if self.server.iconsCache.get(favFilename):
@ -1362,6 +1366,8 @@ class PubServer(BaseHTTPRequestHandler):
favBinary, cookie,
callingDomain)
self._write(favBinary)
if self.server.debug:
print('Sent favicon from cache: ' + callingDomain)
return
else:
if os.path.isfile(faviconFilename):
@ -1373,7 +1379,11 @@ class PubServer(BaseHTTPRequestHandler):
callingDomain)
self._write(favBinary)
self.server.iconsCache[favFilename] = favBinary
if self.server.debug:
print('Sent favicon from file: ' + callingDomain)
return
if self.server.debug:
print('favicon not sent: ' + callingDomain)
self._404()
return
@ -1446,6 +1456,9 @@ class PubServer(BaseHTTPRequestHandler):
fontBinary, cookie,
callingDomain)
self._write(fontBinary)
if self.server.debug:
print('font sent from cache: ' +
self.path + ' ' + callingDomain)
return
else:
if os.path.isfile(fontFilename):
@ -1457,7 +1470,12 @@ class PubServer(BaseHTTPRequestHandler):
callingDomain)
self._write(fontBinary)
self.server.fontsCache[fontStr] = fontBinary
if self.server.debug:
print('font sent from file: ' +
self.path + ' ' + callingDomain)
return
if self.server.debug:
print('font not found: ' + self.path + ' ' + callingDomain)
self._404()
return
@ -1512,7 +1530,13 @@ class PubServer(BaseHTTPRequestHandler):
self._set_headers('text/xml', len(msg),
cookie, callingDomain)
self._write(msg)
if self.server.debug:
print('Sent rss2 feed: ' +
self.path + ' ' + callingDomain)
return
if self.server.debug:
print('Failed to get rss2 feed: ' +
self.path + ' ' + callingDomain)
self._404()
return
@ -1550,7 +1574,13 @@ class PubServer(BaseHTTPRequestHandler):
self._set_headers('text/plain; charset=utf-8',
len(msg), cookie, callingDomain)
self._write(msg)
if self.server.debug:
print('Sent rss3 feed: ' +
self.path + ' ' + callingDomain)
return
if self.server.debug:
print('Failed to get rss3 feed: ' +
self.path + ' ' + callingDomain)
self._404()
return