hotfix for failed scandir

This commit is contained in:
Andrew 2021-12-21 16:11:48 -05:00
parent b3cb6006e9
commit 3e2d2c89ee
2 changed files with 4 additions and 6 deletions

View File

@ -653,9 +653,9 @@ class Helpers:
@staticmethod
def generate_tree(folder, output=""):
for file in sorted(os.scandir(folder), key=lambda e: e.name):
filename = html.escape(file.name)
rel = os.path.join(folder, filename)
for raw_filename in os.listdir(folder):
filename = html.escape(raw_filename)
rel = os.path.join(folder, raw_filename)
if os.path.isdir(rel):
output += \
"""<li class="tree-item" data-path="{}">

View File

@ -25,11 +25,9 @@ class HTTPHandlerPage(BaseHandler):
def get(self, page):
url = self.request.full_url
port = 443
print(url)
if url[len(url)-1] == '/':
url = url.strip(url[len(url)-1])
url_list = url.split('/')
print(url_list)
if url_list[0] != "":
primary_url = url_list[0] + ":"+str(port)+"/"
backup_url = url_list[0] + ":" +str(helper.get_setting["https_port"]) +"/"