Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
7d053cfe
Commit
7d053cfe
authored
6 years ago
by
Andrew Morgan
Browse files
Options
Downloads
Patches
Plain Diff
Retry on 400:M_UNRECOGNIZED
parent
7e75d964
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/matrixfederationclient.py
+10
-6
10 additions, 6 deletions
synapse/http/matrixfederationclient.py
with
10 additions
and
6 deletions
synapse/http/matrixfederationclient.py
+
10
−
6
View file @
7d053cfe
...
@@ -474,8 +474,7 @@ class MatrixFederationHttpClient(object):
...
@@ -474,8 +474,7 @@ class MatrixFederationHttpClient(object):
long_retries
=
False
,
timeout
=
None
,
long_retries
=
False
,
timeout
=
None
,
ignore_backoff
=
False
,
ignore_backoff
=
False
,
backoff_on_404
=
False
,
backoff_on_404
=
False
,
try_trailing_slash_on_404
=
False
,
try_trailing_slash_on_404
=
False
):
):
"""
Sends the specifed json data using PUT
"""
Sends the specifed json data using PUT
Args:
Args:
...
@@ -662,14 +661,19 @@ class MatrixFederationHttpClient(object):
...
@@ -662,14 +661,19 @@ class MatrixFederationHttpClient(object):
response
=
yield
self
.
_send_request
(
**
send_request_args
)
response
=
yield
self
.
_send_request
(
**
send_request_args
)
body
=
yield
_handle_json_response
(
self
.
hs
.
get_reactor
(),
self
.
default_timeout
,
request
,
response
,
)
# If enabled, retry with a trailing slash if we received a 404
# If enabled, retry with a trailing slash if we received a 404
if
try_trailing_slash_on_404
and
response
.
code
==
404
:
# or if a 400 with "M_UNRECOGNIZED" which some endpoints return
if
(
try_trailing_slash_on_404
and
(
response
.
code
==
404
or
(
response
.
code
==
400
and
body
.
get
(
"
errcode
"
)
==
"
M_UNRECOGNIZED
"
))):
args
[
"
path
"
]
+=
"
/
"
args
[
"
path
"
]
+=
"
/
"
response
=
yield
self
.
_send_request
(
**
send_request_args
)
response
=
yield
self
.
_send_request
(
**
send_request_args
)
body
=
yield
_handle_json_response
(
self
.
hs
.
get_reactor
(),
self
.
default_timeout
,
request
,
response
,
)
defer
.
returnValue
(
body
)
defer
.
returnValue
(
body
)
@defer.inlineCallbacks
@defer.inlineCallbacks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment