Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 22ea51f

Browse files
Add support for compression to federation responses (#13537)
Closes #13415. Signed-off-by: Ayush Anand <[email protected]>
1 parent 84169a8 commit 22ea51f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

changelog.d/13537.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for compression to federation responses.

docs/usage/configuration/config_documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Sub-options for each listener include:
444444
* `names`: a list of names of HTTP resources. See below for a list of valid resource names.
445445

446446
* `compress`: set to true to enable gzip compression on HTTP bodies for this resource. This is currently only supported with the
447-
`client`, `consent` and `metrics` resources.
447+
`client`, `consent`, `metrics` and `federation` resources.
448448

449449
* `additional_resources`: Only valid for an 'http' listener. A map of
450450
additional endpoints which should be loaded via dynamic modules.

synapse/app/homeserver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ def _configure_named_resource(
220220
resources.update({"/_matrix/consent": consent_resource})
221221

222222
if name == "federation":
223-
resources.update({FEDERATION_PREFIX: TransportLayerServer(self)})
223+
federation_resource: Resource = TransportLayerServer(self)
224+
if compress:
225+
federation_resource = gz_wrap(federation_resource)
226+
resources.update({FEDERATION_PREFIX: federation_resource})
224227

225228
if name == "openid":
226229
resources.update(

0 commit comments

Comments
 (0)