Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
9dba8132
Commit
9dba8132
authored
9 years ago
by
Daniel Wagner-Hall
Browse files
Options
Downloads
Patches
Plain Diff
Remove redundant if-guard
The startswith("@") does the job
parent
559c51de
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/api/auth.py
+12
-13
12 additions, 13 deletions
synapse/api/auth.py
with
12 additions
and
13 deletions
synapse/api/auth.py
+
12
−
13
View file @
9dba8132
...
...
@@ -521,23 +521,22 @@ class Auth(object):
# Check state_key
if
hasattr
(
event
,
"
state_key
"
):
if
not
event
.
state_key
.
startswith
(
"
_
"
):
if
event
.
state_key
.
startswith
(
"
@
"
):
if
event
.
state_key
!=
event
.
user_id
:
if
event
.
state_key
.
startswith
(
"
@
"
):
if
event
.
state_key
!=
event
.
user_id
:
raise
AuthError
(
403
,
"
You are not allowed to set others state
"
)
else
:
sender_domain
=
UserID
.
from_string
(
event
.
user_id
).
domain
if
sender_domain
!=
event
.
state_key
:
raise
AuthError
(
403
,
"
You are not allowed to set others state
"
)
else
:
sender_domain
=
UserID
.
from_string
(
event
.
user_id
).
domain
if
sender_domain
!=
event
.
state_key
:
raise
AuthError
(
403
,
"
You are not allowed to set others state
"
)
return
True
...
...
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