Commits

Anonymous committed f7fe0d0

added version, comment parameters to set_cookie. Fixed bug with consuming file uploads

Comments (0)

Files changed (3)

   knowledge about current browsers).  Similarly,
   ``req.referer_search_query()`` is gone.
 
+* Added parameters ``version`` and ``comment`` to
+  ``Response.set_cookie()``, per William Dode's suggestion.
+
+* Was accidentally consuming file uploads, instead of putting the
+  ``FieldStorage`` object directly in the parameters.
+
 0.8.1
 -----
 

webob/__init__.py

     app_iter = property(_app_iter__get, _app_iter__set, _app_iter__del, doc=_app_iter__get.__doc__)
 
     def set_cookie(self, key, value='', max_age=None,
-                   path='/', domain=None, secure=None, httponly=False):
+                   path='/', domain=None, secure=None, httponly=False,
+                   version=None, comment=None):
         """
         Set (add) a cookie for the response
         """
             ('domain', domain),
             ('secure', secure),
             ('HttpOnly', httponly),
+            ('version', version),
+            ('comment', comment),
             ]:
             if var_value is not None and var_value is not False:
                 cookies[key][var_name.replace('_', '-')] = str(var_value)

webob/multidict.py

         if fs.list:
             # fs.list can be None when there's nothing to parse
             for field in fs.list:
-                obj.add(field.name, field.value)
+                if field.file:
+                    obj.add(field.name, field)
+                else:
+                    obj.add(field.name, field.value)
         return obj
 
     from_fieldstorage = classmethod(from_fieldstorage)