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

Commit

Permalink
Add support for compression to federation responses (#13537)
Browse files Browse the repository at this point in the history
Closes #13415.

Signed-off-by: Ayush Anand <iamayushanand@gmail.com>
  • Loading branch information
iamayushanand committed Aug 18, 2022
1 parent 84169a8 commit 22ea51f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/13537.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for compression to federation responses.
2 changes: 1 addition & 1 deletion docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ Sub-options for each listener include:
* `names`: a list of names of HTTP resources. See below for a list of valid resource names.

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

* `additional_resources`: Only valid for an 'http' listener. A map of
additional endpoints which should be loaded via dynamic modules.
Expand Down
5 changes: 4 additions & 1 deletion synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ def _configure_named_resource(
resources.update({"/_matrix/consent": consent_resource})

if name == "federation":
resources.update({FEDERATION_PREFIX: TransportLayerServer(self)})
federation_resource: Resource = TransportLayerServer(self)
if compress:
federation_resource = gz_wrap(federation_resource)
resources.update({FEDERATION_PREFIX: federation_resource})

if name == "openid":
resources.update(
Expand Down

0 comments on commit 22ea51f

Please sign in to comment.