Skip to content

Commit a2c92e8

Browse files
committed
Fix guess_type defalut behavior
1 parent bd3baa8 commit a2c92e8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/mimetypes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def add_type(self, type, ext, strict=True):
9090
list of standard types, else to the list of non-standard
9191
types.
9292
"""
93+
if not type and ext in self.types_map[strict]:
94+
type = self.types_map[strict][ext]
9395
self.types_map[strict][ext] = type
9496
exts = self.types_map_inv[strict].setdefault(type, [])
9597
if ext not in exts:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix :meth:`mimetypes.MimeTypes.guess_type` to use default mapping for empty
2+
``Content-Type`` in registry.

0 commit comments

Comments
 (0)