mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-23 23:12:59 +03:00
Not include charset when charset is None (#7400)
This commit is contained in:
parent
36bd1b30d8
commit
d46d5cbaaa
|
@ -179,9 +179,11 @@ class APIRequestFactory(DjangoRequestFactory):
|
||||||
ret = renderer.render(data)
|
ret = renderer.render(data)
|
||||||
|
|
||||||
# Determine the content-type header from the renderer
|
# Determine the content-type header from the renderer
|
||||||
content_type = "{}; charset={}".format(
|
content_type = renderer.media_type
|
||||||
renderer.media_type, renderer.charset
|
if renderer.charset:
|
||||||
)
|
content_type = "{}; charset={}".format(
|
||||||
|
content_type, renderer.charset
|
||||||
|
)
|
||||||
|
|
||||||
# Coerce text to bytes if required.
|
# Coerce text to bytes if required.
|
||||||
if isinstance(ret, str):
|
if isinstance(ret, str):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user