Full path for css file

main
Bob Mottram 2022-05-09 10:40:08 +01:00
parent 75e134bae7
commit 414525bbc4
1 changed files with 4 additions and 2 deletions

View File

@ -14049,7 +14049,7 @@ class PubServer(BaseHTTPRequestHandler):
return True return True
return False return False
def _get_style_sheet(self, calling_domain: str, path: str, def _get_style_sheet(self, base_dir: str, calling_domain: str, path: str,
getreq_start_time) -> bool: getreq_start_time) -> bool:
"""Returns the content of a css file """Returns the content of a css file
""" """
@ -14057,6 +14057,7 @@ class PubServer(BaseHTTPRequestHandler):
# eg. /my/path/file.css becomes file.css # eg. /my/path/file.css becomes file.css
if '/' in path: if '/' in path:
path = path.split('/')[-1] path = path.split('/')[-1]
path = base_dir + '/' + path
if os.path.isfile(path): if os.path.isfile(path):
tries = 0 tries = 0
while tries < 5: while tries < 5:
@ -15431,7 +15432,8 @@ 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 self._get_style_sheet(calling_domain, self.path, if self._get_style_sheet(self.server.base_dir,
calling_domain, self.path,
getreq_start_time): getreq_start_time):
return return