Possible to disable length header on sitemeda

This commit is contained in:
shortcutme 2016-11-16 11:19:35 +01:00
parent 2e08d68d87
commit 6c74f6c527

View file

@ -318,7 +318,7 @@ class UiRequest(object):
# Serve a media for site
def actionSiteMedia(self, path):
def actionSiteMedia(self, path, header_length=True):
path_parts = self.parsePath(path)
# Check wrapper nonce
@ -354,7 +354,7 @@ class UiRequest(object):
from Debug import DebugMedia
DebugMedia.merge(file_path)
if os.path.isfile(file_path): # File exists
return self.actionFile(file_path)
return self.actionFile(file_path, header_length=header_length)
elif os.path.isdir(file_path): # If this is actually a folder, add "/" and redirect
return self.actionRedirect("./{0}/".format(path_parts["inner_path"].split("/")[-1]))
else: # File not exists, try to download
@ -365,7 +365,7 @@ class UiRequest(object):
result = site.needFile(path_parts["inner_path"], priority=5) # Wait until file downloads
if result:
return self.actionFile(file_path)
return self.actionFile(file_path, header_length=header_length)
else:
self.log.debug("File not found: %s" % path_parts["inner_path"])
# Site larger than allowed, re-add wrapper nonce to allow reload