equal
deleted
inserted
replaced
79 |
79 |
80 super(CubicWebWsgiRequest, self).__init__(vreg, https, post, |
80 super(CubicWebWsgiRequest, self).__init__(vreg, https, post, |
81 headers= headers_in) |
81 headers= headers_in) |
82 self.content = environ['wsgi.input'] |
82 self.content = environ['wsgi.input'] |
83 if files is not None: |
83 if files is not None: |
84 for key, part in files.iteritems(): |
84 for key, part in files.items(): |
85 self.form[key] = (part.filename, part.file) |
85 self.form[key] = (part.filename, part.file) |
86 |
86 |
87 def __repr__(self): |
87 def __repr__(self): |
88 # Since this is called as part of error handling, we need to be very |
88 # Since this is called as part of error handling, we need to be very |
89 # robust against potentially malformed input. |
89 # robust against potentially malformed input. |
146 # get_posted_data |
146 # get_posted_data |
147 self.form = {} |
147 self.form = {} |
148 if params is None: |
148 if params is None: |
149 return |
149 return |
150 encoding = self.encoding |
150 encoding = self.encoding |
151 for param, val in params.iteritems(): |
151 for param, val in params.items(): |
152 if isinstance(val, (tuple, list)): |
152 if isinstance(val, (tuple, list)): |
153 val = [ |
153 val = [ |
154 unicode(x, encoding) if isinstance(x, str) else x |
154 unicode(x, encoding) if isinstance(x, str) else x |
155 for x in val] |
155 for x in val] |
156 if len(val) == 1: |
156 if len(val) == 1: |