Serve files without wrapper if requested using /raw/ prefix

This commit is contained in:
shortcutme 2017-07-09 14:10:01 +02:00
parent 6c0062dbc1
commit febdea6c64
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
4 changed files with 33 additions and 13 deletions

View file

@ -12,7 +12,7 @@ class UiRequestPlugin(object):
super(UiRequestPlugin, self).__init__(*args, **kwargs)
# Media request
def actionSiteMedia(self, path, header_length=True):
def actionSiteMedia(self, path, **kwargs):
match = re.match("/media/(?P<address>[A-Za-z0-9-]+\.[A-Za-z0-9\.-]+)(?P<inner_path>/.*|$)", path)
if match: # Its a valid domain, resolve first
domain = match.group("address")