mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
Merge pull request #17013 from athoik/fix-17000
fix: handle unicode filenames in external document loader
This commit is contained in:
commit
4e7b0ea4b4
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import requests
|
||||
import logging, os
|
||||
from typing import Iterator, List, Union
|
||||
from urllib.parse import quote
|
||||
|
||||
from langchain_core.document_loaders import BaseLoader
|
||||
from langchain_core.documents import Document
|
||||
|
|
@ -37,7 +38,7 @@ class ExternalDocumentLoader(BaseLoader):
|
|||
headers["Authorization"] = f"Bearer {self.api_key}"
|
||||
|
||||
try:
|
||||
headers["X-Filename"] = os.path.basename(self.file_path)
|
||||
headers["X-Filename"] = quote(os.path.basename(self.file_path))
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue