Skip to content
Snippets Groups Projects
Unverified Commit 22ea51fa authored by Ayush Anand's avatar Ayush Anand Committed by GitHub
Browse files

Add support for compression to federation responses (#13537)


Closes #13415.

Signed-off-by: default avatarAyush Anand <iamayushanand@gmail.com>
parent 84169a82
No related branches found
No related tags found
No related merge requests found
Add support for compression to federation responses.
...@@ -444,7 +444,7 @@ Sub-options for each listener include: ...@@ -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. * `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 * `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_resources`: Only valid for an 'http' listener. A map of
additional endpoints which should be loaded via dynamic modules. additional endpoints which should be loaded via dynamic modules.
......
...@@ -220,7 +220,10 @@ class SynapseHomeServer(HomeServer): ...@@ -220,7 +220,10 @@ class SynapseHomeServer(HomeServer):
resources.update({"/_matrix/consent": consent_resource}) resources.update({"/_matrix/consent": consent_resource})
if name == "federation": 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": if name == "openid":
resources.update( resources.update(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment