]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix setting cookies under WSGI, broken by the rename from _new_cookies to _new_cookie...
authorCasey Muller <github@nullterminated.com>
Sun, 6 May 2012 18:18:29 +0000 (11:18 -0700)
committerCasey Muller <github@nullterminated.com>
Sun, 6 May 2012 18:18:29 +0000 (11:18 -0700)
tornado/wsgi.py

index 73e0af1bd1f04832d845a9f99f8af84094627d48..564b1fac2ffec352aa2c538f2912b41bacd0bea1 100644 (file)
@@ -96,8 +96,8 @@ class WSGIApplication(web.Application):
         status = str(handler._status_code) + " " + \
             httplib.responses[handler._status_code]
         headers = handler._headers.items()
-        for cookie_dict in getattr(handler, "_new_cookies", []):
-            for cookie in cookie_dict.values():
+        if hasattr(handler, "_new_cookie"):
+            for cookie in handler._new_cookie.values():
                 headers.append(("Set-Cookie", cookie.OutputString(None)))
         start_response(status,
                        [(native_str(k), native_str(v)) for (k, v) in headers])