better urls by making it yourself
This commit is contained in:
27
code/app.py
27
code/app.py
@@ -939,20 +939,21 @@ def zip_clean():
|
||||
def get_download_url(share, file, token):
|
||||
direct = get_or_none('direct_links', share, False)
|
||||
if direct:
|
||||
return request.url_root + url_for(
|
||||
'download_direct',
|
||||
name = share['name'],
|
||||
token = get_direct_token(share, file),
|
||||
filename = file
|
||||
)
|
||||
return "/".join((
|
||||
app.config['PUBLIC_URL'],
|
||||
'direct',
|
||||
share['name'],
|
||||
get_direct_token(share, file),
|
||||
path2url(file)
|
||||
))
|
||||
else:
|
||||
return request.url_root + url_for(
|
||||
'download_token',
|
||||
name = share['name'],
|
||||
filename = file,
|
||||
token = token
|
||||
)
|
||||
|
||||
return "/".join((
|
||||
app.config['PUBLIC_URL'],
|
||||
'download',
|
||||
share['name'],
|
||||
token,
|
||||
path2url(file)
|
||||
))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user