Fix encoding for robots.txt view response
This commit is contained in:
parent
cfb6cf5ab4
commit
cb2234cef5
|
@ -84,7 +84,14 @@ class CommonView(View):
|
|||
"""
|
||||
with open(self.robots_txt_path, 'rt') as f:
|
||||
content = f.read()
|
||||
return Response(content_type=six.binary_type('text/plain'), body=content)
|
||||
response = self.request.response
|
||||
if six.PY3:
|
||||
response.text = content
|
||||
response.content_type = 'text/plain'
|
||||
else:
|
||||
response.body = content
|
||||
response.content_type = b'text/plain'
|
||||
return response
|
||||
|
||||
def mobile_home(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue