Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
731dfff3
Unverified
Commit
731dfff3
authored
4 years ago
by
Patrick Cloke
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Ensure a group ID is valid before trying to get rooms for it. (#8129)
parent
76c43f08
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/8129.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/8129.bugfix
synapse/rest/client/v2_alpha/groups.py
+4
-0
4 additions, 0 deletions
synapse/rest/client/v2_alpha/groups.py
with
5 additions
and
0 deletions
changelog.d/8129.bugfix
0 → 100644
+
1
−
0
View file @
731dfff3
Return a proper error code when the rooms of an invalid group are requested.
This diff is collapsed.
Click to expand it.
synapse/rest/client/v2_alpha/groups.py
+
4
−
0
View file @
731dfff3
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
import
logging
import
logging
from
synapse.api.errors
import
SynapseError
from
synapse.http.servlet
import
RestServlet
,
parse_json_object_from_request
from
synapse.http.servlet
import
RestServlet
,
parse_json_object_from_request
from
synapse.types
import
GroupID
from
synapse.types
import
GroupID
...
@@ -325,6 +326,9 @@ class GroupRoomServlet(RestServlet):
...
@@ -325,6 +326,9 @@ class GroupRoomServlet(RestServlet):
requester
=
await
self
.
auth
.
get_user_by_req
(
request
,
allow_guest
=
True
)
requester
=
await
self
.
auth
.
get_user_by_req
(
request
,
allow_guest
=
True
)
requester_user_id
=
requester
.
user
.
to_string
()
requester_user_id
=
requester
.
user
.
to_string
()
if
not
GroupID
.
is_valid
(
group_id
):
raise
SynapseError
(
400
,
"
%s was not legal group ID
"
%
(
group_id
,))
result
=
await
self
.
groups_handler
.
get_rooms_in_group
(
result
=
await
self
.
groups_handler
.
get_rooms_in_group
(
group_id
,
requester_user_id
group_id
,
requester_user_id
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment