Skip to content

Commit ed1cf28

Browse files
authored
fix Chinese doc retriever (#2226)
Signed-off-by: Yongbozzz <[email protected]>
1 parent 0eabdbf commit ed1cf28

File tree

1 file changed

+2
-3
lines changed
  • EdgeCraftRAG/edgecraftrag/api/v1

1 file changed

+2
-3
lines changed

EdgeCraftRAG/edgecraftrag/api/v1/data.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from edgecraftrag.api_schema import DataIn, FilesIn
77
from edgecraftrag.context import ctx
88
from fastapi import FastAPI, File, HTTPException, UploadFile, status
9-
from werkzeug.utils import secure_filename
109

1110
data_app = FastAPI()
1211

@@ -110,9 +109,9 @@ async def upload_file(file_name: str, file: UploadFile = File(...)):
110109
status_code=status.HTTP_400_BAD_REQUEST, detail="Invalid file_name: directory traversal detected"
111110
)
112111
os.makedirs(UPLOAD_DIRECTORY, exist_ok=True)
113-
safe_filename = secure_filename(file.filename)
112+
safe_filename = file.filename
114113
# Sanitize the uploaded file's name
115-
safe_filename = secure_filename(file.filename)
114+
safe_filename = file.filename
116115
file_path = os.path.normpath(os.path.join(UPLOAD_DIRECTORY, safe_filename))
117116
# Ensure file_path is within UPLOAD_DIRECTORY
118117
if not file_path.startswith(os.path.abspath(UPLOAD_DIRECTORY)):

0 commit comments

Comments
 (0)