mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
(cherry picked from commit 303043f506
)
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
This commit is contained in:
parent
320316ef7e
commit
d78e113d1b
2 changed files with 4 additions and 0 deletions
|
@ -95,6 +95,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue