You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some folks are experiencing issues where they are getting a list rather than plain dict. I think it's from multiple entries in the multidict. Converting to a regular dict will fix it.
The text was updated successfully, but these errors were encountered:
A little more follow up on this. Here's the new request dict implementation (see request_dict.py):
Learnmoreorgiveusfeedbackimportflaskfromwerkzeug.datastructuresimportMultiDictclassRequestDictionary(dict):
def__init__(self, *args, default_val=None, **kwargs):
self.default_val=default_valsuper().__init__(*args, **kwargs)
def__getattr__(self, key):
returnself.get(key, self.default_val)
defcreate(default_val=None, **route_args) ->RequestDictionary:
request=flask.request# Adding this retro actively. Some folks are experiencing issues where they# are getting a list rather than plain dict. I think it's from multiple# entries in the multidict. This should fix it.args=request.argsifisinstance(request.args, MultiDict):
args=request.args.to_dict()
form=request.formifisinstance(request.args, MultiDict):
form=request.form.to_dict()
data= {
**args, # The key/value pairs in the URL query string**request.headers, # Header values**form, # The key/value pairs in the body, from a HTML post form**route_args# And additional arguments the method access, if they want them merged.
}
returnRequestDictionary(data, default_val=default_val)
Some folks are experiencing issues where they are getting a list rather than plain dict. I think it's from multiple entries in the multidict. Converting to a regular dict will fix it.
The text was updated successfully, but these errors were encountered: