mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 17:36:18 -05:00
Special handling for csv mimetype files.
This commit is contained in:
parent
3751ed7999
commit
94e4cce1f2
1 changed files with 7 additions and 4 deletions
|
|
@ -101,10 +101,13 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
|
|||
suffix = path.suffix.lower()
|
||||
if mimetype == 'application/octet-stream' and suffix.endswith('.mobi'):
|
||||
return MOBI_MIMETYPE
|
||||
if mimetype == 'text/plain' and suffix.endswith('.json'):
|
||||
return 'application/json'
|
||||
if mimetype == 'text/plain' and suffix.endswith('.vtt'):
|
||||
return 'text/vtt'
|
||||
if mimetype == 'text/plain':
|
||||
if suffix.endswith('.json'):
|
||||
return 'application/json'
|
||||
if suffix.endswith('.vtt'):
|
||||
return 'text/vtt'
|
||||
if suffix.endswith('.csv'):
|
||||
return 'text/csv'
|
||||
return mimetype
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue