[2.0.x] Reverted "Fixed #29511 -- Added charset to JavaScriptCatalog's Content-Type header."

This reverts commit 8e082a6e0b as it
doesn't qualify for a backport.
This commit is contained in:
Tim Graham 2018-06-25 09:41:04 -04:00
parent 8e082a6e0b
commit 4b3b9fab08
2 changed files with 1 additions and 2 deletions

View File

@ -311,7 +311,7 @@ class JavaScriptCatalog(View):
) if context['catalog'] else None
context['formats_str'] = indent(json.dumps(context['formats'], sort_keys=True, indent=2))
return HttpResponse(template.render(Context(context)), 'text/javascript; charset="utf-8"')
return HttpResponse(template.render(Context(context)), 'text/javascript')
class JSONCatalog(JavaScriptCatalog):

View File

@ -200,7 +200,6 @@ class I18NViewTests(SimpleTestCase):
catalog = gettext.translation('djangojs', locale_dir, [lang_code])
trans_txt = catalog.gettext('this is to be translated')
response = self.client.get('/jsi18n/')
self.assertEqual(response['Content-Type'], 'text/javascript; charset="utf-8"')
# response content must include a line like:
# "this is to be translated": <value of trans_txt Python variable>
# json.dumps() is used to be able to check unicode strings