summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-11-13 12:05:55 +0000
committerErik Johnston <erik@matrix.org>2020-11-13 12:05:55 +0000
commit52984e9e695ac446e43fec0d8676f71c1130c837 (patch)
treecd9e2a02704aefa0e3f560bd6439f271466427f7 /synapse/http
parentMerge branch 'rav/fix_sighup' into matrix-org-hotfixes (diff)
parentAdd metrics for tracking 3PID /requestToken requests. (#8712) (diff)
downloadsynapse-52984e9e695ac446e43fec0d8676f71c1130c837.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/matrixfederationclient.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py

index 04766ca965..7e17cdb73e 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -1063,13 +1063,19 @@ def check_content_type_is_json(headers): """ c_type = headers.getRawHeaders(b"Content-Type") if c_type is None: - raise RequestSendFailed(RuntimeError("No Content-Type header"), can_retry=False) + raise RequestSendFailed( + RuntimeError("No Content-Type header received from remote server"), + can_retry=False, + ) c_type = c_type[0].decode("ascii") # only the first header val, options = cgi.parse_header(c_type) if val != "application/json": raise RequestSendFailed( - RuntimeError("Content-Type not application/json: was '%s'" % c_type), + RuntimeError( + "Remote server sent Content-Type header of '%s', not 'application/json'" + % c_type, + ), can_retry=False, )