mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
fixed issue where text/html files being detected as text when loaded
This commit is contained in:
parent
4a825dce7f
commit
453a2bd9b5
1 changed files with 4 additions and 1 deletions
|
|
@ -226,7 +226,10 @@ class Loader:
|
|||
|
||||
def _is_text_file(self, file_ext: str, file_content_type: str) -> bool:
|
||||
return file_ext in known_source_ext or (
|
||||
file_content_type and file_content_type.find("text/") >= 0
|
||||
file_content_type
|
||||
and file_content_type.find("text/") >= 0
|
||||
# Avoid text/html files being detected as text
|
||||
and not file_content_type.find("html") >= 0
|
||||
)
|
||||
|
||||
def _get_loader(self, filename: str, file_content_type: str, file_path: str):
|
||||
|
|
|
|||
Loading…
Reference in a new issue