Skip to content
Browse files

Return a write method from start_response, as required by the wsgi spec.

  • Loading branch information...
1 parent 32a31f4 commit 5f4413bec42dcccce2d85f1421b49218fc5d6712 Ben Darnell committed Mar 31, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 tornado/wsgi.py
View
6 tornado/wsgi.py
@@ -211,11 +211,13 @@ def __init__(self, wsgi_application):
def __call__(self, request):
data = {}
+ response = []
def start_response(status, response_headers, exc_info=None):
data["status"] = status
data["headers"] = response_headers
- response = self.wsgi_application(
- WSGIContainer.environ(request), start_response)
+ return response.append
+ response.extend(self.wsgi_application(
+ WSGIContainer.environ(request), start_response))
body = "".join(response)
if hasattr(response, "close"):
response.close()

0 comments on commit 5f4413b

Please sign in to comment.
Something went wrong with that request. Please try again.