Less indentation

merge-requests/30/head
Bob Mottram 2021-02-26 16:06:25 +00:00
parent e751eecf1e
commit f393e78b14
1 changed files with 38 additions and 34 deletions

View File

@ -9734,11 +9734,17 @@ class PubServer(BaseHTTPRequestHandler):
GETstartTime, GETtimings: {}) -> bool:
"""Show a shared item image
"""
if self._pathIsImage(path):
if not self._pathIsImage(path):
self._404()
return True
mediaStr = path.split('/sharefiles/')[1]
mediaFilename = \
baseDir + '/sharefiles/' + mediaStr
if os.path.isfile(mediaFilename):
if not os.path.isfile(mediaFilename):
self._404()
return True
if self._etag_exists(mediaFilename):
# The file has not changed
self._304()
@ -9768,8 +9774,6 @@ class PubServer(BaseHTTPRequestHandler):
'show media done',
'share files shown')
return True
self._404()
return True
def _showAvatarOrBanner(self, callingDomain: str, path: str,
baseDir: str, domain: str,