Skip to content

Commit

Permalink
fix folder name suffix checking` (infiniflow#2194)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh authored Sep 2, 2024
1 parent 532f0ee commit f99bdd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/apps/file_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ def rename():
e, file = FileService.get_by_id(req["file_id"])
if not e:
return get_data_error_result(retmsg="File not found!")
if pathlib.Path(req["name"].lower()).suffix != pathlib.Path(
if file.type != FileType.FOLDER.value \
and pathlib.Path(req["name"].lower()).suffix != pathlib.Path(
file.name.lower()).suffix:
return get_json_result(
data=False,
Expand Down

0 comments on commit f99bdd5

Please sign in to comment.