diff options
author | RUANG (James Roy) <longjinyii@outlook.com> | 2025-02-14 17:26:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-14 17:26:26 (GMT) |
commit | 303043f5062c1e7ffb7907abde61dbf13c98f8e9 (patch) | |
tree | 603d91aa78959ab18838171990806b598dc8a356 /Lib/mimetypes.py | |
parent | 3402e133ef26736296c07992266a82b181a5d532 (diff) | |
download | cpython-303043f5062c1e7ffb7907abde61dbf13c98f8e9.zip cpython-303043f5062c1e7ffb7907abde61dbf13c98f8e9.tar.gz cpython-303043f5062c1e7ffb7907abde61dbf13c98f8e9.tar.bz2 |
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
Diffstat (limited to 'Lib/mimetypes.py')
-rw-r--r-- | Lib/mimetypes.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 7532383..3e1c3cf 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -90,6 +90,8 @@ class MimeTypes: list of standard types, else to the list of non-standard types. """ + if not type: + return self.types_map[strict][ext] = type exts = self.types_map_inv[strict].setdefault(type, []) if ext not in exts: |