We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Custom media handlers: Unexpected issue when providing custom json handler
This is in falcon-2.0

Look at the documentation [here][1] for using rapidjson for encoding/decoding json. By providing:

`extra_handlers={'application/json': json_handler}` we are still left with the default handler for content-type `application-json; charset=UTF-8`. This results in an unexpected behaviour when some client library (e.g. Retrofit for Android) includes the charset in the header. 

While the documentation should be updated, the expected behaviour is that if the handler for `application/json` is updated - it should also update the handler for variant with charset (or at least throw a warning) otherwise there is a possibility of hidden bugs. 

[1]: https://falcon.readthedocs.io/en/stable/api/media.html

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `falcon/media/handlers.py`
Content:
```
1 from collections import UserDict
2 
3 from falcon import errors
4 from falcon.constants import MEDIA_MULTIPART, MEDIA_URLENCODED
5 from falcon.media.json import JSONHandler
6 from falcon.media.multipart import MultipartFormHandler, MultipartParseOptions
7 from falcon.media.urlencoded import URLEncodedFormHandler
8 from falcon.vendor import mimeparse
9 
10 
11 class Handlers(UserDict):
12     """A :class:`dict`-like object that manages Internet media type handlers."""
13     def __init__(self, initial=None):
14         handlers = initial or {
15             'application/json': JSONHandler(),
16             'application/json; charset=UTF-8': JSONHandler(),
17             MEDIA_MULTIPART: MultipartFormHandler(),
18             MEDIA_URLENCODED: URLEncodedFormHandler(),
19         }
20 
21         # NOTE(jmvrbanac): Directly calling UserDict as it's not inheritable.
22         # Also, this results in self.update(...) being called.
23         UserDict.__init__(self, handlers)
24 
25     def _resolve_media_type(self, media_type, all_media_types):
26         resolved = None
27 
28         try:
29             # NOTE(jmvrbanac): Mimeparse will return an empty string if it can
30             # parse the media type, but cannot find a suitable type.
31             resolved = mimeparse.best_match(
32                 all_media_types,
33                 media_type
34             )
35         except ValueError:
36             pass
37 
38         return resolved
39 
40     def find_by_media_type(self, media_type, default):
41         # PERF(jmvrbanac): Check via a quick methods first for performance
42         if media_type == '*/*' or not media_type:
43             media_type = default
44 
45         try:
46             return self.data[media_type]
47         except KeyError:
48             pass
49 
50         # PERF(jmvrbanac): Fallback to the slower method
51         resolved = self._resolve_media_type(media_type, self.data.keys())
52 
53         if not resolved:
54             raise errors.HTTPUnsupportedMediaType(
55                 description='{0} is an unsupported media type.'.format(media_type)
56             )
57 
58         return self.data[resolved]
59 
60 
61 # NOTE(vytas): An ugly way to work around circular imports.
62 MultipartParseOptions._DEFAULT_HANDLERS = Handlers({
63     'application/json': JSONHandler(),
64     'application/json; charset=UTF-8': JSONHandler(),
65     MEDIA_URLENCODED: URLEncodedFormHandler(),
66 })  # type: ignore
67
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/falcon/media/handlers.py b/falcon/media/handlers.py
--- a/falcon/media/handlers.py
+++ b/falcon/media/handlers.py
@@ -1,7 +1,7 @@
 from collections import UserDict
 
 from falcon import errors
-from falcon.constants import MEDIA_MULTIPART, MEDIA_URLENCODED
+from falcon.constants import MEDIA_JSON, MEDIA_MULTIPART, MEDIA_URLENCODED
 from falcon.media.json import JSONHandler
 from falcon.media.multipart import MultipartFormHandler, MultipartParseOptions
 from falcon.media.urlencoded import URLEncodedFormHandler
@@ -12,8 +12,7 @@
     """A :class:`dict`-like object that manages Internet media type handlers."""
     def __init__(self, initial=None):
         handlers = initial or {
-            'application/json': JSONHandler(),
-            'application/json; charset=UTF-8': JSONHandler(),
+            MEDIA_JSON: JSONHandler(),
             MEDIA_MULTIPART: MultipartFormHandler(),
             MEDIA_URLENCODED: URLEncodedFormHandler(),
         }
@@ -60,7 +59,6 @@
 
 # NOTE(vytas): An ugly way to work around circular imports.
 MultipartParseOptions._DEFAULT_HANDLERS = Handlers({
-    'application/json': JSONHandler(),
-    'application/json; charset=UTF-8': JSONHandler(),
+    MEDIA_JSON: JSONHandler(),
     MEDIA_URLENCODED: URLEncodedFormHandler(),
 })  # type: ignore

{"golden_diff": "diff --git a/falcon/media/handlers.py b/falcon/media/handlers.py\n--- a/falcon/media/handlers.py\n+++ b/falcon/media/handlers.py\n@@ -1,7 +1,7 @@\n from collections import UserDict\n \n from falcon import errors\n-from falcon.constants import MEDIA_MULTIPART, MEDIA_URLENCODED\n+from falcon.constants import MEDIA_JSON, MEDIA_MULTIPART, MEDIA_URLENCODED\n from falcon.media.json import JSONHandler\n from falcon.media.multipart import MultipartFormHandler, MultipartParseOptions\n from falcon.media.urlencoded import URLEncodedFormHandler\n@@ -12,8 +12,7 @@\n     \"\"\"A :class:`dict`-like object that manages Internet media type handlers.\"\"\"\n     def __init__(self, initial=None):\n         handlers = initial or {\n-            'application/json': JSONHandler(),\n-            'application/json; charset=UTF-8': JSONHandler(),\n+            MEDIA_JSON: JSONHandler(),\n             MEDIA_MULTIPART: MultipartFormHandler(),\n             MEDIA_URLENCODED: URLEncodedFormHandler(),\n         }\n@@ -60,7 +59,6 @@\n \n # NOTE(vytas): An ugly way to work around circular imports.\n MultipartParseOptions._DEFAULT_HANDLERS = Handlers({\n-    'application/json': JSONHandler(),\n-    'application/json; charset=UTF-8': JSONHandler(),\n+    MEDIA_JSON: JSONHandler(),\n     MEDIA_URLENCODED: URLEncodedFormHandler(),\n })  # type: ignore\n", "issue": "Custom media handlers: Unexpected issue when providing custom json handler\nThis is in falcon-2.0\r\n\r\nLook at the documentation [here][1] for using rapidjson for encoding/decoding json. By providing:\r\n\r\n`extra_handlers={'application/json': json_handler}` we are still left with the default handler for content-type `application-json; charset=UTF-8`. This results in an unexpected behaviour when some client library (e.g. Retrofit for Android) includes the charset in the header. \r\n\r\nWhile the documentation should be updated, the expected behaviour is that if the handler for `application/json` is updated - it should also update the handler for variant with charset (or at least throw a warning) otherwise there is a possibility of hidden bugs. \r\n\r\n[1]: https://falcon.readthedocs.io/en/stable/api/media.html\n", "before_files": [{"content": "from collections import UserDict\n\nfrom falcon import errors\nfrom falcon.constants import MEDIA_MULTIPART, MEDIA_URLENCODED\nfrom falcon.media.json import JSONHandler\nfrom falcon.media.multipart import MultipartFormHandler, MultipartParseOptions\nfrom falcon.media.urlencoded import URLEncodedFormHandler\nfrom falcon.vendor import mimeparse\n\n\nclass Handlers(UserDict):\n    \"\"\"A :class:`dict`-like object that manages Internet media type handlers.\"\"\"\n    def __init__(self, initial=None):\n        handlers = initial or {\n            'application/json': JSONHandler(),\n            'application/json; charset=UTF-8': JSONHandler(),\n            MEDIA_MULTIPART: MultipartFormHandler(),\n            MEDIA_URLENCODED: URLEncodedFormHandler(),\n        }\n\n        # NOTE(jmvrbanac): Directly calling UserDict as it's not inheritable.\n        # Also, this results in self.update(...) being called.\n        UserDict.__init__(self, handlers)\n\n    def _resolve_media_type(self, media_type, all_media_types):\n        resolved = None\n\n        try:\n            # NOTE(jmvrbanac): Mimeparse will return an empty string if it can\n            # parse the media type, but cannot find a suitable type.\n            resolved = mimeparse.best_match(\n                all_media_types,\n                media_type\n            )\n        except ValueError:\n            pass\n\n        return resolved\n\n    def find_by_media_type(self, media_type, default):\n        # PERF(jmvrbanac): Check via a quick methods first for performance\n        if media_type == '*/*' or not media_type:\n            media_type = default\n\n        try:\n            return self.data[media_type]\n        except KeyError:\n            pass\n\n        # PERF(jmvrbanac): Fallback to the slower method\n        resolved = self._resolve_media_type(media_type, self.data.keys())\n\n        if not resolved:\n            raise errors.HTTPUnsupportedMediaType(\n                description='{0} is an unsupported media type.'.format(media_type)\n            )\n\n        return self.data[resolved]\n\n\n# NOTE(vytas): An ugly way to work around circular imports.\nMultipartParseOptions._DEFAULT_HANDLERS = Handlers({\n    'application/json': JSONHandler(),\n    'application/json; charset=UTF-8': JSONHandler(),\n    MEDIA_URLENCODED: URLEncodedFormHandler(),\n})  # type: ignore\n", "path": "falcon/media/handlers.py"}], "after_files": [{"content": "from collections import UserDict\n\nfrom falcon import errors\nfrom falcon.constants import MEDIA_JSON, MEDIA_MULTIPART, MEDIA_URLENCODED\nfrom falcon.media.json import JSONHandler\nfrom falcon.media.multipart import MultipartFormHandler, MultipartParseOptions\nfrom falcon.media.urlencoded import URLEncodedFormHandler\nfrom falcon.vendor import mimeparse\n\n\nclass Handlers(UserDict):\n    \"\"\"A :class:`dict`-like object that manages Internet media type handlers.\"\"\"\n    def __init__(self, initial=None):\n        handlers = initial or {\n            MEDIA_JSON: JSONHandler(),\n            MEDIA_MULTIPART: MultipartFormHandler(),\n            MEDIA_URLENCODED: URLEncodedFormHandler(),\n        }\n\n        # NOTE(jmvrbanac): Directly calling UserDict as it's not inheritable.\n        # Also, this results in self.update(...) being called.\n        UserDict.__init__(self, handlers)\n\n    def _resolve_media_type(self, media_type, all_media_types):\n        resolved = None\n\n        try:\n            # NOTE(jmvrbanac): Mimeparse will return an empty string if it can\n            # parse the media type, but cannot find a suitable type.\n            resolved = mimeparse.best_match(\n                all_media_types,\n                media_type\n            )\n        except ValueError:\n            pass\n\n        return resolved\n\n    def find_by_media_type(self, media_type, default):\n        # PERF(jmvrbanac): Check via a quick methods first for performance\n        if media_type == '*/*' or not media_type:\n            media_type = default\n\n        try:\n            return self.data[media_type]\n        except KeyError:\n            pass\n\n        # PERF(jmvrbanac): Fallback to the slower method\n        resolved = self._resolve_media_type(media_type, self.data.keys())\n\n        if not resolved:\n            raise errors.HTTPUnsupportedMediaType(\n                description='{0} is an unsupported media type.'.format(media_type)\n            )\n\n        return self.data[resolved]\n\n\n# NOTE(vytas): An ugly way to work around circular imports.\nMultipartParseOptions._DEFAULT_HANDLERS = Handlers({\n    MEDIA_JSON: JSONHandler(),\n    MEDIA_URLENCODED: URLEncodedFormHandler(),\n})  # type: ignore\n", "path": "falcon/media/handlers.py"}]}