mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-19 13:23:16 +08:00
* Revert "path traversal bug in api /knowledge_base/download_doc(#4008) (#4009)" This reverts commit 2c146aff74bac427f0a4921971d8472097410bdf. * Update utils.py
This commit is contained in:
parent
2c146aff74
commit
ede538bfe2
@ -43,7 +43,7 @@ def get_vs_path(knowledge_base_name: str, vector_name: str):
|
||||
|
||||
def get_file_path(knowledge_base_name: str, doc_name: str):
|
||||
doc_path = Path(get_doc_path(knowledge_base_name))
|
||||
file_path = doc_path / doc_name
|
||||
file_path = (doc_path / doc_name).resolve()
|
||||
if file_path.is_relative_to(doc_path):
|
||||
return str(file_path)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user