From 2e2be463f87871cf36f5b72e7cf32e8c67caa67f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 11 Mar 2016 10:29:05 +0000 Subject: [PATCH] Make key client send a Host header --- synapse/crypto/keyclient.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synapse/crypto/keyclient.py b/synapse/crypto/keyclient.py index 784d02f12..54b83da9d 100644 --- a/synapse/crypto/keyclient.py +++ b/synapse/crypto/keyclient.py @@ -36,6 +36,7 @@ def fetch_server_key(server_name, ssl_context_factory, path=KEY_API_V1): factory = SynapseKeyClientFactory() factory.path = path + factory.host = server_name endpoint = matrix_federation_endpoint( reactor, server_name, ssl_context_factory, timeout=30 ) @@ -81,6 +82,8 @@ class SynapseKeyClientProtocol(HTTPClient): self.host = self.transport.getHost() logger.debug("Connected to %s", self.host) self.sendCommand(b"GET", self.path) + if self.host: + self.sendHeader(b"Host", self.host) self.endHeaders() self.timer = reactor.callLater( self.timeout,