Not include charset when charset is None (#7400)

This commit is contained in:
Minjae Kim 2020-07-07 17:58:32 +09:00 committed by GitHub
parent 36bd1b30d8
commit d46d5cbaaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,8 +179,10 @@ class APIRequestFactory(DjangoRequestFactory):
ret = renderer.render(data)
# Determine the content-type header from the renderer
content_type = renderer.media_type
if renderer.charset:
content_type = "{}; charset={}".format(
renderer.media_type, renderer.charset
content_type, renderer.charset
)
# Coerce text to bytes if required.