Skip to content

Commit

Permalink
Check meta data format in json map (#4461)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

#3690

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
KevinHuSh authored Jan 13, 2025
1 parent d8346cb commit c083820
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/apps/document_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@ def set_meta():
except Exception as e:
return get_json_result(
data=False, message=f'Json syntax error: {e}', code=settings.RetCode.ARGUMENT_ERROR)
if not isinstance(meta, dict):
return get_json_result(
data=False, message='Meta data should be in Json map format, like {"key": "value"}', code=settings.RetCode.ARGUMENT_ERROR)

try:
e, doc = DocumentService.get_by_id(req["doc_id"])
if not e:
Expand Down

0 comments on commit c083820

Please sign in to comment.