fix extension - remove dot
The rest of our extensions don't have a dot. Also, strip off any characters and lowercase it to be safe.
This commit is contained in:
parent
eaacf7e034
commit
43b372c0fe
1 changed files with 1 additions and 1 deletions
|
@ -154,5 +154,5 @@ types_map = {
|
||||||
|
|
||||||
def guess_media_type(path):
|
def guess_media_type(path):
|
||||||
_, ext = os.path.splitext(path)
|
_, ext = os.path.splitext(path)
|
||||||
default = f'application/x-ext-{ext}' if ext else 'application/octet-stream'
|
default = 'application/octet-stream' if not ext else f'application/x-ext-{ext[1:].strip().lower()}'
|
||||||
return types_map.get(ext, default)
|
return types_map.get(ext, default)
|
||||||
|
|
Loading…
Reference in a new issue