diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-09-02 18:29:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-02 18:29:21 +0100 |
commit | 36f34e6f3d551ac7f1bcd92771502d8e37722c33 (patch) | |
tree | dd843bb9784c70627cc2f8cad8192cb3010a425f /synapse/http/client.py | |
parent | fix thumbnail storage location (#5915) (diff) | |
download | synapse-36f34e6f3d551ac7f1bcd92771502d8e37722c33.tar.xz |
Remove unused methods from c/s api v1 in register.py (#5963)
These methods were part of the v1 C/S API. Remove them as they are no longer used by any code paths.
Diffstat (limited to '')
-rw-r--r-- | synapse/http/client.py | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index 0ac20ebefc..0ae6db8ea7 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -35,7 +35,7 @@ from twisted.internet.interfaces import ( ) from twisted.python.failure import Failure from twisted.web._newclient import ResponseDone -from twisted.web.client import Agent, HTTPConnectionPool, PartialDownloadError, readBody +from twisted.web.client import Agent, HTTPConnectionPool, readBody from twisted.web.http import PotentialDataLoss from twisted.web.http_headers import Headers @@ -599,38 +599,6 @@ def _readBodyToFile(response, stream, max_size): return d -class CaptchaServerHttpClient(SimpleHttpClient): - """ - Separate HTTP client for talking to google's captcha servers - Only slightly special because accepts partial download responses - - used only by c/s api v1 - """ - - @defer.inlineCallbacks - def post_urlencoded_get_raw(self, url, args={}): - query_bytes = urllib.parse.urlencode(encode_urlencode_args(args), True) - - response = yield self.request( - "POST", - url, - data=query_bytes, - headers=Headers( - { - b"Content-Type": [b"application/x-www-form-urlencoded"], - b"User-Agent": [self.user_agent], - } - ), - ) - - try: - body = yield make_deferred_yieldable(readBody(response)) - return body - except PartialDownloadError as e: - # twisted dislikes google's response, no content length. - return e.response - - def encode_urlencode_args(args): return {k: encode_urlencode_arg(v) for k, v in args.items()} |