From 5e98347a6df9c584b84a751e29e1bb25be50cce7 Mon Sep 17 00:00:00 2001 From: Eujin Ong <62314480+euj1n0ng@users.noreply.github.com> Date: Wed, 28 Sep 2022 23:34:05 +0700 Subject: [PATCH] Replace obsolete JS media type --- falcon/constants.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/falcon/constants.py b/falcon/constants.py index e3585aece..c206adba1 100644 --- a/falcon/constants.py +++ b/falcon/constants.py @@ -105,14 +105,10 @@ # contrary to the RFCs. MEDIA_XML = 'application/xml' -# NOTE(kgriffs): RFC 4329 recommends application/* over text/. -# furthermore, parsers are required to respect the Unicode -# encoding signature, if present in the document, and to default -# to UTF-8 when not present. Note, however, that implementations -# are not required to support anything besides UTF-8, so it is -# unclear how much utility an encoding signature (or the charset -# parameter for that matter) has in practice. -MEDIA_JS = 'application/javascript' +# NOTE: According to RFC 9239, Changed the intended usage of the +# media type "text/javascript" from OBSOLETE to COMMON. Changed +# the intended usage for all other script media types to obsolete. +MEDIA_JS = 'text/javascript' # NOTE(kgriffs): According to RFC 6838, most text media types should # include the charset parameter.