Commit 2118c13b authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

subtle isLeaf issue with EDITOR

parent 79dc4c13
......@@ -93,7 +93,7 @@ def maker (path, queue):
class FileMaker (Resource):
def __init__(self, path, makeRequestsQueue, docroot, index="index.html", makefile=None):
# print ("FileMaker", path, docroot, makefile, cwd)
# print ("FileMaker", path, docroot, makefile)
self.path = path
self.makeRequestsQueue = makeRequestsQueue
self.docroot = docroot
......@@ -132,6 +132,7 @@ class FileMaker (Resource):
ret.isLeaf = True
return ret
# print ("FILE", request.path, request.uri, request.method, dir(request), request.getAllHeaders())
# print ("FILE", request.path, request.uri, request.method)
query = parse_qs2(urlparse(request.uri).query)
xRequestedWith = request.getHeader("x-requested-with")
referer = request.getHeader('referer')
......@@ -147,6 +148,7 @@ class FileMaker (Resource):
and ext not in TEXT_SERVE_BY_DEFAULT \
and base != self.index \
and is_text_file(fpath):
# print ("returning EDITOR", EDITOR, EDITOR.isLeaf)
return EDITOR
elif "edit" in query:
return EDITOR
......@@ -221,6 +223,7 @@ def main (args=None):
# raise Exception("Makefile not found")
EDITOR = File(os.path.join(corehtdocspath, "editor/editor.html"))
EDITOR.isLeaf = True # wow, this was subtle to find! .... fixes weird bug for requests that have subpaths (where returning the EDITOR would then (indirectly) trigger a 404 as subpaths were attempted to explore)
if args.index:
listing = args.index
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment