Now attempt to handle case when query/form array param has a single value, still should be in array
This commit is contained in:
10
app.py
10
app.py
@@ -266,11 +266,17 @@ def execute_http_function(user_id, function):
|
||||
|
||||
# Add form data if it exists
|
||||
if request.form:
|
||||
request_data['form'] = {key.rstrip('[]'): request.form.getlist(key) if len(request.form.getlist(key)) > 1 else request.form.getlist(key)[0] for key in request.form.keys()}
|
||||
request_data['form'] = {
|
||||
key.rstrip('[]'): request.form.getlist(key) if key.endswith('[]') or len(request.form.getlist(key)) > 1 else request.form.getlist(key)[0]
|
||||
for key in request.form.keys()
|
||||
}
|
||||
|
||||
# Add query parameters if they exist
|
||||
if request.args:
|
||||
request_data['query'] = {key.rstrip('[]'): request.args.getlist(key) if len(request.args.getlist(key)) > 1 else request.args.getlist(key)[0] for key in request.args.keys()}
|
||||
request_data['query'] = {
|
||||
key.rstrip('[]'): request.args.getlist(key) if key.endswith('[]') or len(request.args.getlist(key)) > 1 else request.args.getlist(key)[0]
|
||||
for key in request.args.keys()
|
||||
}
|
||||
|
||||
# Add plain text data if it exists
|
||||
if request.data and not request.is_json:
|
||||
|
||||
Reference in New Issue
Block a user