|
@@ -121,7 +121,7 @@ def upload():
|
|
name = get_filename(_hash)
|
|
name = get_filename(_hash)
|
|
mimetype = get_file_mimetype(name)
|
|
mimetype = get_file_mimetype(name)
|
|
validate_file(_hash, root='rest/static/files', download=True, mimetype=mimetype)
|
|
validate_file(_hash, root='rest/static/files', download=True, mimetype=mimetype)
|
|
- if mimetype is not True and mimetype.startswith('text'):
|
|
|
|
|
|
+ if mimetype and mimetype is not True and mimetype.startswith('text'):
|
|
mimetype = None if size and size > CLIP_SIZE_LIMIT else mimetype
|
|
mimetype = None if size and size > CLIP_SIZE_LIMIT else mimetype
|
|
|
|
|
|
link = f'{LOCATION}/upload/{_hash}' if _hash else f'{LOCATION}/upload'
|
|
link = f'{LOCATION}/upload/{_hash}' if _hash else f'{LOCATION}/upload'
|