Example #1
0
 def translate_path(self, path):
     """For paths starting with /cgi-bin/, serve from cgi_dir"""
     paths = path.split("/")
     if len(paths) > 1 and paths[0] == "" and paths[1] not in [
             'server', 'client', 'cgi-bin'
     ]:
         return os.path.join('', 'index.html')
     return CGIHTTPRequestHandler.translate_path(self, path)
Example #2
0
 def translate_path(self, path):
     """For paths starting with /cgi-bin/, serve from cgi_dir"""
     elts = path.split('/')
     if len(elts)>1 and elts[0]=='' and elts[1]=='cgi-bin':
         return os.path.join(cgi_dir,*elts[2:])
     return CGIHTTPRequestHandler.translate_path(self, path)
Example #3
0
 def translate_path(self, path):
     """For paths starting with /cgi-bin/, serve from cgi_dir"""
     elts = path.split('/')
     if len(elts)>1 and elts[0]=='' and elts[1]=='cgi-bin':
         return os.path.join(cgi_dir,*elts[2:])
     return CGIHTTPRequestHandler.translate_path(self, path)
Example #4
0
 def translate_path(self, path):
     if path.find("/../") >= 0:
         path = "/"
     path = CGIHTTPRequestHandler.translate_path(self, path)
     return path
Example #5
0
 def translate_path(self, path):
     if path in self.subst:
         return self.subst[path]
     else:
         return CGIHTTPRequestHandler.translate_path(self, path)
Example #6
0
 def translate_path(self, path):
     if path.find("/../") >= 0:
         path = "/"
     path = CGIHTTPRequestHandler.translate_path(self, path)
     return path
Example #7
0
 def translate_path(self, path):
     if path in self.subst:
         return self.subst[path]
     else:
         return CGIHTTPRequestHandler.translate_path(self, path)
Example #8
0
 def translate_path(self, path):
     return CGIHTTPRequestHandler.translate_path(self, path)
Example #9
0
 def translate_path(self, path):
     if self.respondedWithFile:
         if os.path.isfile(self.respondedWithFile):
             return self.respondedWithFile
     return CGIHTTPRequestHandler.translate_path(self, path)