Merge branch 'dev' into feature/cog-3160-redis-session-conversation

This commit is contained in:
hajdul88 2025-10-21 09:12:14 +02:00 committed by GitHub
commit 47f0b577df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,6 +124,12 @@ def guess_file_type(file: BinaryIO) -> filetype.Type:
"""
file_type = filetype.guess(file)
# If file type could not be determined consider it a plain text file as they don't have magic number encoding
if file_type is None:
from filetype.types.base import Type
file_type = Type("text/plain", "txt")
if file_type is None:
raise FileTypeException(f"Unknown file detected: {file.name}.")