tar + directories are now handled correctly

This commit is contained in:
Sebastian Lohff 2012-04-27 15:43:58 +02:00
parent f51a98bf1b
commit b5c43664e2
1 changed files with 4 additions and 3 deletions

View File

@ -541,10 +541,11 @@ class ServeFile():
raise ServeFileException("Error: Could not open file!") raise ServeFileException("Error: Could not open file!")
handler = FileHandler handler = FileHandler
elif self.serveMode == self.MODE_SINGLETAR: elif self.serveMode == self.MODE_SINGLETAR:
if not os.path.exists(self.target): self.realTarget = os.path.realpath(self.target)
if not os.path.exists(self.realTarget):
raise ServeFileException("Error: Could not open file or directory") raise ServeFileException("Error: Could not open file or directory")
TarFileHandler.target = self.target TarFileHandler.target = self.realTarget
TarFileHandler.fileName = os.path.basename(self.target.rstrip("/")) TarFileHandler.fileName = os.path.basename(self.realTarget.rstrip("/"))
handler = TarFileHandler handler = TarFileHandler
elif self.serveMode == self.MODE_UPLOAD: elif self.serveMode == self.MODE_UPLOAD: