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.


     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)


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