]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Reinstate RequestHandler.cookies property
authorBen Darnell <ben@bendarnell.com>
Sun, 28 Aug 2011 06:02:57 +0000 (23:02 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 28 Aug 2011 06:02:57 +0000 (23:02 -0700)
tornado/test/web_test.py
tornado/web.py

index 465f5feaacb6af7316c053587709444a300b881f..e6aaa59b65e13ac53229ac029a00d61f50982c5e 100644 (file)
@@ -238,6 +238,8 @@ class TypeCheckHandler(RequestHandler):
         # get_argument is an exception from the general rule of using
         # type str for non-body data mainly for historical reasons.
         self.check_type('argument', self.get_argument('foo'), unicode)
+        self.check_type('cookie_key', self.cookies.keys()[0], str)
+        self.check_type('cookie_value', self.cookies.values()[0].value, str)
 
         self.check_type('xsrf_token', self.xsrf_token, bytes_type)
         self.check_type('xsrf_form_html', self.xsrf_form_html(), str)
index 91c76adeb1d7d74c893b914041778cdb5634bad3..cab45647541d9666e0090fe132cd0599cb9c3cfa 100644 (file)
@@ -316,6 +316,10 @@ class RequestHandler(object):
         """
         return _unicode(value)
 
+    @property
+    def cookies(self):
+        return self.request.cookies
+
     def get_cookie(self, name, default=None):
         """Gets the value of the cookie with the given name, else default."""
         if name in self.request.cookies: