mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 09:54:11 -04:00
Add additional validation to pusher URLs. (#8865)
Pusher URLs now must end in `/_matrix/push/v1/notify` per the specification.
This commit is contained in:
parent
df3e6a23a7
commit
b774c555d8
6 changed files with 107 additions and 31 deletions
|
@ -67,7 +67,7 @@ class PusherShardTestCase(BaseMultiWorkerStreamTestCase):
|
|||
device_display_name="pushy push",
|
||||
pushkey="a@example.com",
|
||||
lang=None,
|
||||
data={"url": "https://push.example.com/push"},
|
||||
data={"url": "https://push.example.com/_matrix/push/v1/notify"},
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -109,7 +109,7 @@ class PusherShardTestCase(BaseMultiWorkerStreamTestCase):
|
|||
http_client_mock.post_json_get_json.assert_called_once()
|
||||
self.assertEqual(
|
||||
http_client_mock.post_json_get_json.call_args[0][0],
|
||||
"https://push.example.com/push",
|
||||
"https://push.example.com/_matrix/push/v1/notify",
|
||||
)
|
||||
self.assertEqual(
|
||||
event_id,
|
||||
|
@ -161,7 +161,7 @@ class PusherShardTestCase(BaseMultiWorkerStreamTestCase):
|
|||
http_client_mock2.post_json_get_json.assert_not_called()
|
||||
self.assertEqual(
|
||||
http_client_mock1.post_json_get_json.call_args[0][0],
|
||||
"https://push.example.com/push",
|
||||
"https://push.example.com/_matrix/push/v1/notify",
|
||||
)
|
||||
self.assertEqual(
|
||||
event_id,
|
||||
|
@ -183,7 +183,7 @@ class PusherShardTestCase(BaseMultiWorkerStreamTestCase):
|
|||
http_client_mock2.post_json_get_json.assert_called_once()
|
||||
self.assertEqual(
|
||||
http_client_mock2.post_json_get_json.call_args[0][0],
|
||||
"https://push.example.com/push",
|
||||
"https://push.example.com/_matrix/push/v1/notify",
|
||||
)
|
||||
self.assertEqual(
|
||||
event_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue