diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-18 17:37:43 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-18 17:37:43 +0000 |
commit | 7025781df8ab295848cb70a43d0ff8ca5949bc19 (patch) | |
tree | 14421f92093e915babba2bc51d00f5d48ebf9437 /synapse/http/client.py | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.7.1 (diff) | |
parent | Merge pull request #82 from matrix-org/git_tag_version (diff) | |
download | synapse-7025781df8ab295848cb70a43d0ff8ca5949bc19.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.7.1
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r-- | synapse/http/client.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index e46e7db146..22b7145ac1 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -14,7 +14,6 @@ # limitations under the License. from synapse.api.errors import CodeMessageException -from synapse.http.agent_name import AGENT_NAME from syutil.jsonutil import encode_canonical_json from twisted.internet import defer, reactor @@ -44,6 +43,7 @@ class SimpleHttpClient(object): # BrowserLikePolicyForHTTPS which will do regular cert validation # 'like a browser' self.agent = Agent(reactor) + self.version_string = hs.version_string @defer.inlineCallbacks def post_urlencoded_get_json(self, uri, args={}): @@ -55,7 +55,7 @@ class SimpleHttpClient(object): uri.encode("ascii"), headers=Headers({ b"Content-Type": [b"application/x-www-form-urlencoded"], - b"User-Agent": [AGENT_NAME], + b"User-Agent": [self.version_string], }), bodyProducer=FileBodyProducer(StringIO(query_bytes)) ) @@ -108,7 +108,7 @@ class SimpleHttpClient(object): "GET", uri.encode("ascii"), headers=Headers({ - b"User-Agent": [AGENT_NAME], + b"User-Agent": [self.version_string], }) ) @@ -149,7 +149,7 @@ class SimpleHttpClient(object): "PUT", uri.encode("ascii"), headers=Headers({ - b"User-Agent": [AGENT_NAME], + b"User-Agent": [self.version_string], "Content-Type": ["application/json"] }), bodyProducer=FileBodyProducer(StringIO(json_str)) @@ -182,7 +182,7 @@ class CaptchaServerHttpClient(SimpleHttpClient): bodyProducer=FileBodyProducer(StringIO(query_bytes)), headers=Headers({ b"Content-Type": [b"application/x-www-form-urlencoded"], - b"User-Agent": [AGENT_NAME], + b"User-Agent": [self.version_string], }) ) |