From: Casey Muller Date: Sun, 6 May 2012 18:18:29 +0000 (-0700) Subject: Fix setting cookies under WSGI, broken by the rename from _new_cookies to _new_cookie... X-Git-Tag: v2.3.0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3ed68a31d66a203aff2a1ebd8a9baa68d526f3e;p=thirdparty%2Ftornado.git Fix setting cookies under WSGI, broken by the rename from _new_cookies to _new_cookie in https://github.com/facebook/tornado/commit/70ea7a5a6ca956b613168c9d123ee7cc951054bf --- diff --git a/tornado/wsgi.py b/tornado/wsgi.py index 73e0af1bd..564b1fac2 100644 --- a/tornado/wsgi.py +++ b/tornado/wsgi.py @@ -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])