diff --git a/api/app.py b/api/app.py index 72e9c3a3e..ec16cb0bc 100644 --- a/api/app.py +++ b/api/app.py @@ -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: @@ -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}") @@ -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