1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Fixed #20472: response.content should be bytes on both Python 2 and 3

This commit is contained in:
Łukasz Langa
2013-05-21 00:41:23 +02:00
parent 4ba1c2e785
commit 0594fed9ff
2 changed files with 26 additions and 2 deletions

View File

@@ -31,13 +31,13 @@ def conditional_content_removal(request, response):
if response.streaming:
response.streaming_content = []
else:
response.content = ''
response.content = b''
response['Content-Length'] = '0'
if request.method == 'HEAD':
if response.streaming:
response.streaming_content = []
else:
response.content = ''
response.content = b''
return response