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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user