merge-requests/8/head
Bob Mottram 2020-09-02 11:49:35 +01:00
parent 0a656ab9ca
commit c6c17f4743
1 changed files with 6 additions and 2 deletions

View File

@ -7309,11 +7309,15 @@ class PubServer(BaseHTTPRequestHandler):
# get css # get css
# Note that this comes before the busy flag to avoid conflicts # Note that this comes before the busy flag to avoid conflicts
if self.path.endswith('.css'): if self.path.endswith('.css'):
if os.path.isfile('epicyon-profile.css'): # get the last part of the path
# eg. /my/path/file.css becomes file.css
if '/' in self.path:
self.path = self.path.split('/')[-1]
if os.path.isfile(self.path):
tries = 0 tries = 0
while tries < 5: while tries < 5:
try: try:
with open('epicyon-profile.css', 'r') as cssfile: with open(self.path, 'r') as cssfile:
css = cssfile.read() css = cssfile.read()
break break
except Exception as e: except Exception as e: