[wsgi] fix handling of multiple posted files
We were only keeping the last received file.
--- a/cubicweb/wsgi/request.py Fri Feb 05 18:23:00 2016 +0100
+++ b/cubicweb/wsgi/request.py Mon Feb 08 16:39:51 2016 +0100
@@ -81,8 +81,12 @@
headers= headers_in)
self.content = environ['wsgi.input']
if files is not None:
- for key, part in files.items():
- self.form[key] = (part.filename, part.file)
+ for key, part in files.iterallitems():
+ self.form.setdefault(key, []).append((part.filename, part.file))
+ # 3.16.4 backward compat
+ for key in files.keys():
+ if len(self.form[key]) == 1:
+ self.form[key] = self.form[key][0]
def __repr__(self):
# Since this is called as part of error handling, we need to be very