Skip to content

Commit

Permalink
Or perhaps I was the one who was drunk
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Mar 13, 2019
1 parent bec3138 commit 66cdb84
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def _send_request_with_optional_trailing_slash(
self,
request,
try_trailing_slash_on_400=False,
backoff_on_404=False,
**kwargs):
"""Wrapper for _send_request which can optionally retry the request
upon receiving a combination of a 400 HTTP response code and a
Expand All @@ -205,9 +204,6 @@ def _send_request_with_optional_trailing_slash(
try_trailing_slash_on_400 (bool): Whether on receiving a 400
'M_UNRECOGNIZED' from the server to retry the request with a
trailing slash appended to the request path.
backoff_on_404 (bool): Whether to backoff on 404 when making a
request with a trailing slash (only affects request if
try_trailing_slash_on_400 is True).
kwargs (Dict): A dictionary of arguments to pass to
`_send_request()`.
Expand Down Expand Up @@ -585,7 +581,7 @@ def put_json(self, destination, path, args={}, data={},
}

response = yield self._send_request_with_optional_trailing_slash(
request, try_trailing_slash_on_400, backoff_on_404, **send_request_args)
request, try_trailing_slash_on_400, **send_request_args)

body = yield _handle_json_response(
self.hs.get_reactor(), self.default_timeout, request, response,
Expand Down Expand Up @@ -701,10 +697,11 @@ def get_json(self, destination, path, args=None, retry_on_dns_fail=True,
"retry_on_dns_fail": retry_on_dns_fail,
"timeout": timeout,
"ignore_backoff": ignore_backoff,
"backoff_on_404": False,
}

response = yield self._send_request_with_optional_trailing_slash(
request, try_trailing_slash_on_400, False, **send_request_args)
request, try_trailing_slash_on_400, **send_request_args)

body = yield _handle_json_response(
self.hs.get_reactor(), self.default_timeout, request, response,
Expand Down

0 comments on commit 66cdb84

Please sign in to comment.