mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -162,7 +162,8 @@ def populate_apache_request(http_response, mod_python_req):
|
||||
for c in http_response.cookies.values():
|
||||
mod_python_req.headers_out.add('Set-Cookie', c.output(header=''))
|
||||
mod_python_req.status = http_response.status_code
|
||||
mod_python_req.write(http_response.get_content_as_string(settings.DEFAULT_CHARSET))
|
||||
for chunk in http_response.iterator:
|
||||
mod_python_req.write(chunk)
|
||||
|
||||
def handler(req):
|
||||
# mod_python hooks into this function.
|
||||
|
||||
@@ -172,6 +172,5 @@ class WSGIHandler(BaseHandler):
|
||||
response_headers = response.headers.items()
|
||||
for c in response.cookies.values():
|
||||
response_headers.append(('Set-Cookie', c.output(header='')))
|
||||
output = [response.get_content_as_string(settings.DEFAULT_CHARSET)]
|
||||
start_response(status, response_headers)
|
||||
return output
|
||||
return response.iterator
|
||||
|
||||
Reference in New Issue
Block a user