diff options
author | David Baker <dave@matrix.org> | 2017-04-21 11:32:48 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-04-21 11:32:48 +0100 |
commit | a90a0f5c8a38ff7f99a12dd436b75680d3fee747 (patch) | |
tree | 46cd84b656d2a0c410c19c2c46fdca2a95b289b7 /synapse/server.py | |
parent | Merge pull request #2115 from matrix-org/erikj/dedupe_federation_repl (diff) | |
download | synapse-a90a0f5c8a38ff7f99a12dd436b75680d3fee747.tar.xz |
Propagate errors sensibly from proxied IS requests
When we're proxying Matrix endpoints, parse out Matrix error responses and turn them into SynapseErrors so they can be propagated sensibly upstream.
Diffstat (limited to '')
-rw-r--r-- | synapse/server.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py index 6310152560..f73aef19c8 100644 --- a/synapse/server.py +++ b/synapse/server.py @@ -48,7 +48,9 @@ from synapse.handlers.typing import TypingHandler from synapse.handlers.events import EventHandler, EventStreamHandler from synapse.handlers.initial_sync import InitialSyncHandler from synapse.handlers.receipts import ReceiptsHandler -from synapse.http.client import SimpleHttpClient, InsecureInterceptableContextFactory +from synapse.http.client import ( + SimpleHttpClient, InsecureInterceptableContextFactory, MatrixProxyClient +) from synapse.http.matrixfederationclient import MatrixFederationHttpClient from synapse.notifier import Notifier from synapse.push.pusherpool import PusherPool @@ -127,6 +129,7 @@ class HomeServer(object): 'filtering', 'http_client_context_factory', 'simple_http_client', + 'matrix_proxy_client', 'media_repository', 'federation_transport_client', 'federation_sender', @@ -188,6 +191,9 @@ class HomeServer(object): def build_simple_http_client(self): return SimpleHttpClient(self) + def build_matrix_proxy_client(self): + return MatrixProxyClient(self) + def build_v1auth(self): orf = Auth(self) # Matrix spec makes no reference to what HTTP status code is returned, |