mirror of
https://github.com/python/cpython.git
synced 2025-09-19 23:20:25 +00:00
gh-128703: Fix mimetypes.guess_type for empty Content-Type in registry (GH-128854)
This commit is contained in:
parent
3402e133ef
commit
303043f506
2 changed files with 4 additions and 0 deletions
|
@ -90,6 +90,8 @@ class MimeTypes:
|
||||||
list of standard types, else to the list of non-standard
|
list of standard types, else to the list of non-standard
|
||||||
types.
|
types.
|
||||||
"""
|
"""
|
||||||
|
if not type:
|
||||||
|
return
|
||||||
self.types_map[strict][ext] = type
|
self.types_map[strict][ext] = type
|
||||||
exts = self.types_map_inv[strict].setdefault(type, [])
|
exts = self.types_map_inv[strict].setdefault(type, [])
|
||||||
if ext not in exts:
|
if ext not in exts:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix :func:`mimetypes.guess_type` to use default mapping for empty
|
||||||
|
``Content-Type`` in registry.
|
Loading…
Add table
Add a link
Reference in a new issue