better link for flip, maybe now, a little hack

This commit is contained in:
2018-08-21 15:31:49 +03:00
parent b4cb2ba246
commit b9f35e2a51
2 changed files with 10 additions and 4 deletions

View File

@@ -373,8 +373,14 @@ def file_direct(name, token, filename):
if not allow_direct: if not allow_direct:
return "-1", 403 return "-1", 403
token = get_direct_token(share, filename) token = get_direct_token(share, filename)
url = url_for('download_direct', name = name, token = token, filename = filename ) # url_for returns extra level of /../path if proxying with nginx
return url, 200 return "/".join((
app.config['PUBLIC_URL'],
'direct',
name,
token,
path2url(filename)
)), 200
@app.route('/file/ls/<name>/<token>', methods=['GET']) @app.route('/file/ls/<name>/<token>', methods=['GET'])

View File

@@ -110,8 +110,8 @@ _delete() { # name
} }
_url() { # name _url() { # name
file_path=$( curl -s "$FLEES_ROOTURL/file/direct/$FLEES_SHARE/$FLEES_TOKEN/$1" ) curl -s "$FLEES_ROOTURL/file/direct/$FLEES_SHARE/$FLEES_TOKEN/$1"
echo $FLEES_ROOTURL$file_path echo ''
} }
_msg() { _msg() {
echo "$@" >&2 echo "$@" >&2