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
ec638a16
Commit
ec638a16
authored
5 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Only handle GET requests for /push_rules
parent
20825195
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/workers.rst
+3
-0
3 additions, 0 deletions
docs/workers.rst
synapse/rest/client/v1/push_rule.py
+7
-0
7 additions, 0 deletions
synapse/rest/client/v1/push_rule.py
with
10 additions
and
0 deletions
docs/workers.rst
+
3
−
0
View file @
ec638a16
...
...
@@ -229,6 +229,9 @@ following regular expressions::
^/_matrix/client/(api/v1|r0|unstable)/keys/changes$
^/_matrix/client/versions$
^/_matrix/client/(api/v1|r0|unstable)/voip/turnServer$
Additionally, the following REST endpoints can be handled for GET requests::
^/_matrix/client/(api/v1|r0|unstable)/pushrules/.*$
Additionally, the following REST endpoints can be handled, but all requests must
...
...
This diff is collapsed.
Click to expand it.
synapse/rest/client/v1/push_rule.py
+
7
−
0
View file @
ec638a16
...
...
@@ -39,9 +39,13 @@ class PushRuleRestServlet(ClientV1RestServlet):
super
(
PushRuleRestServlet
,
self
).
__init__
(
hs
)
self
.
store
=
hs
.
get_datastore
()
self
.
notifier
=
hs
.
get_notifier
()
self
.
_is_worker
=
hs
.
config
.
worker_app
is
not
None
@defer.inlineCallbacks
def
on_PUT
(
self
,
request
):
if
self
.
_is_worker
:
raise
Exception
(
"
Cannot handle PUT /push_rules on worker
"
)
spec
=
_rule_spec_from_path
([
x
.
decode
(
'
utf8
'
)
for
x
in
request
.
postpath
])
try
:
priority_class
=
_priority_class_from_spec
(
spec
)
...
...
@@ -103,6 +107,9 @@ class PushRuleRestServlet(ClientV1RestServlet):
@defer.inlineCallbacks
def
on_DELETE
(
self
,
request
):
if
self
.
_is_worker
:
raise
Exception
(
"
Cannot handle DELETE /push_rules on worker
"
)
spec
=
_rule_spec_from_path
([
x
.
decode
(
'
utf8
'
)
for
x
in
request
.
postpath
])
requester
=
yield
self
.
auth
.
get_user_by_req
(
request
)
...
...
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