Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Toperlock committed Jan 23, 2024
1 parent 9a4cabe commit 307b7d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ def config(url):
param = urlparse(encoded_url.split('&', 1)[-1])
request.args = dict(item.split('=') for item in param.path.split('&'))
if request.args.get('prefix'):
i = 1
request.args['prefix'] = unquote(request.args['prefix'])
if request.args.get('file'):
i = 1
index = request.args.get('file').find(":")
next_index = index + 2
if index != -1:
Expand All @@ -145,14 +147,17 @@ def config(url):
param = urlparse(query_string.split('&', 1)[-1])
request.args = dict(item.split('=') for item in param.path.split('&'))
if request.args.get('prefix'):
i = 1
request.args['prefix'] = unquote(request.args['prefix'])
if request.args.get('file'):
i = 1
index = request.args.get('file').find(":")
next_index = index + 2
if index != -1:
if next_index < len(request.args['file']) and request.args['file'][next_index] != "/":
request.args['file'] = request.args['file'][:next_index-1] + "/" + request.args['file'][next_index-1:]
elif 'file=' in query_string:
i = 1
index = query_string.find("file=")
request.args['file'] = query_string.split('file=')[-1].split('&', 1)[0]
#print (f"request.args: {request.args}")
Expand Down Expand Up @@ -189,7 +194,6 @@ def config(url):
# 从url中删除这些字符串
for param in params_to_remove:
if param in full_url:
i = 1
full_url = full_url.replace(param, '')
if request.args.get('url'):
full_url = full_url
Expand Down

0 comments on commit 307b7d3

Please sign in to comment.