mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-02 12:46:06 -04:00
Include version in User-Agent and Server headers
This commit is contained in:
parent
420ccfc925
commit
24b5d01853
4 changed files with 35 additions and 6 deletions
|
@ -20,6 +20,7 @@ from twisted.web.client import readBody, _AgentBase, _URI
|
|||
from twisted.web.http_headers import Headers
|
||||
from twisted.web._newclient import ResponseDone
|
||||
|
||||
from synapse.http.agent_name import AGENT_NAME
|
||||
from synapse.http.endpoint import matrix_federation_endpoint
|
||||
from synapse.util.async import sleep
|
||||
from synapse.util.logcontext import PreserveLoggingContext
|
||||
|
@ -71,6 +72,7 @@ class MatrixFederationHttpClient(object):
|
|||
requests.
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, hs):
|
||||
self.hs = hs
|
||||
self.signing_key = hs.config.signing_key[0]
|
||||
|
@ -83,7 +85,7 @@ class MatrixFederationHttpClient(object):
|
|||
query_bytes=b"", retry_on_dns_fail=True):
|
||||
""" Creates and sends a request to the given url
|
||||
"""
|
||||
headers_dict[b"User-Agent"] = [b"Synapse"]
|
||||
headers_dict[b"User-Agent"] = [AGENT_NAME]
|
||||
headers_dict[b"Host"] = [destination]
|
||||
|
||||
url_bytes = urlparse.urlunparse(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue