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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user