diff options
author | Erik Johnston <erik@matrix.org> | 2022-02-22 12:26:17 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2022-02-22 12:26:17 +0000 |
commit | 07f82ac29be42098ab5b135cb173437f9cd7c754 (patch) | |
tree | 52ede505210af0dd06421e9644fa09705d4703cd /synapse/replication/http/push.py | |
parent | Recommend upgrading treq alongside twisted (#11943) (diff) | |
parent | Update changelog (diff) | |
download | synapse-07f82ac29be42098ab5b135cb173437f9cd7c754.tar.xz |
Merge branch 'release-v1.53'
Diffstat (limited to 'synapse/replication/http/push.py')
-rw-r--r-- | synapse/replication/http/push.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/synapse/replication/http/push.py b/synapse/replication/http/push.py index 6c8db3061e..af5c2f66a7 100644 --- a/synapse/replication/http/push.py +++ b/synapse/replication/http/push.py @@ -13,10 +13,14 @@ # limitations under the License. import logging -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Tuple +from twisted.web.server import Request + +from synapse.http.server import HttpServer from synapse.http.servlet import parse_json_object_from_request from synapse.replication.http._base import ReplicationEndpoint +from synapse.types import JsonDict if TYPE_CHECKING: from synapse.server import HomeServer @@ -48,7 +52,7 @@ class ReplicationRemovePusherRestServlet(ReplicationEndpoint): self.pusher_pool = hs.get_pusherpool() @staticmethod - async def _serialize_payload(app_id, pushkey, user_id): + async def _serialize_payload(app_id: str, pushkey: str, user_id: str) -> JsonDict: # type: ignore[override] payload = { "app_id": app_id, "pushkey": pushkey, @@ -56,7 +60,9 @@ class ReplicationRemovePusherRestServlet(ReplicationEndpoint): return payload - async def _handle_request(self, request, user_id): + async def _handle_request( # type: ignore[override] + self, request: Request, user_id: str + ) -> Tuple[int, JsonDict]: content = parse_json_object_from_request(request) app_id = content["app_id"] @@ -67,5 +73,5 @@ class ReplicationRemovePusherRestServlet(ReplicationEndpoint): return 200, {} -def register_servlets(hs: "HomeServer", http_server): +def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: ReplicationRemovePusherRestServlet(hs).register(http_server) |