Several changes I should have committed sooner, they would be better

with seperate commits but I never got around to it
This commit is contained in:
Logan Joy-Koer
2026-08-23 21:00:22 -07:00
parent 7e9816e52d
commit 853004d433
17 changed files with 419 additions and 54 deletions
+3 -2
View File
@@ -19,7 +19,7 @@ if "p" in argumentsDict:
listText = "<li>Folder: <a href=\"/raw/?p=" + html.escape(os.path.dirname(path)) + "\">..</a></li>"
for i in filesList:
temp = "File: "
if os.path.isdir(filePath + i.name):
if os.path.isdir(filePath + '/' + i.name):
temp = "Folder: "
link = path.rstrip("/") + "/" + i.name
listText += ("<li>" + temp + "<a href=\"/raw/?p=" + html.escape(link) + "\">" + html.escape(i.name) + "</a></li>")
@@ -27,7 +27,8 @@ if "p" in argumentsDict:
responsecontent = page.encode()
else:
contentType = magic.Magic(mime=True).from_file(filePath)
if contentType in (contentTypes + ["application/x-python-code", "text/x-python"]):
print(contentType)
if contentType in (contentTypes + ["application/x-python-code", "text/x-python", "text/x-script.python"]):
if contentType.startswith("text"):
contentType = "text/plain"
responsecontent = open(filePath, "rb").read()