Skip to content

Commit

Permalink
check share_to param
Browse files Browse the repository at this point in the history
  • Loading branch information
imwhatiam committed Aug 23, 2023
1 parent 5f36ce4 commit 58f7263
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions seahub/api2/endpoints/repo_folder_share_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def get(self, request, format=None):
error_msg = 'repo_id invalid.'
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)

share_to = request.GET.get('share_to')
if share_to and share_to not in ('user', 'group'):
error_msg = 'share_to invalid.'
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)

# resource check
repo = seafile_api.get_repo(repo_id)
if not repo:
Expand All @@ -58,8 +63,6 @@ def get(self, request, format=None):

# get share inifo
share_info_list = []
share_to = request.GET.get('share_to')

try:
seafile_db = SeafileDB()
except Exception as e:
Expand Down

0 comments on commit 58f7263

Please sign in to comment.