diff --git a/network/http_server.py b/network/http_server.py index 6794e6c..1e44301 100644 --- a/network/http_server.py +++ b/network/http_server.py @@ -80,6 +80,12 @@ except: print("Please specify a port number and then project folder.") exit() +try: + ORIGINAL_PROJECT = sys.argv[3] +except: + print("Orignal Project Name Was Not Specified.") + ORIGINAL_PROJECT = " not a folder that can exist " + def fileinfo(filename): fd = {} @@ -171,8 +177,16 @@ class handler(BaseHTTPRequestHandler): parsed = [] for i in linked: - if i.startswith(PROJECT): + + # This is a little weird, sometimes the files have the full URL + # to the data. + + if i.startswith(PROJECT): # This is good when the server is on the same machine as the orignal project parsed.append(i[len(PROJECT):]) + + elif i.startswith(ORIGINAL_PROJECT): # This is when the server is a mirror + parsed.append(i[len(ORIGINAL_PROJECT):]) + else: backward = i.count("/..") foldername = filename[:filename.rfind("/")]