fix media type for files without extension
This commit is contained in:
parent
db3e578bcd
commit
8a5f3842fc
1 changed files with 2 additions and 1 deletions
|
@ -153,4 +153,5 @@ types_map = {
|
|||
|
||||
def guess_media_type(path):
|
||||
_, ext = os.path.splitext(path)
|
||||
return types_map.get(ext, f'application/x-ext-{ext}')
|
||||
default = f'application/x-ext-{ext}' if ext else 'application/octet-stream'
|
||||
return types_map.get(ext, default)
|
||||
|
|
Loading…
Reference in a new issue