Skip to content

Commit

Permalink
update "path traversal bug in api /knowledge_base/download_doc(#4008)… (
Browse files Browse the repository at this point in the history
#4017)

* Revert "path traversal bug in api /knowledge_base/download_doc(#4008) (#4009)"

This reverts commit 2c146af.

* Update utils.py
  • Loading branch information
liunux4odoo committed May 14, 2024
1 parent 2c146af commit ede538b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/knowledge_base/utils.py
Expand Up @@ -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)

Expand Down

0 comments on commit ede538b

Please sign in to comment.