forked from seba/servefile
tar + directories are now handled correctly
This commit is contained in:
parent
f51a98bf1b
commit
b5c43664e2
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue