summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-22 17:29:20 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-22 17:29:20 +0100
commit53f6ab1c340fbe9d36945ebb1f24d129a9e6d13a (patch)
treefd25016a959356deef0f83a8df77c4d47730da10 /synapse/http
parentMerge commit '9de6b9411' into anoa/dinsic_release_1_31_0 (diff)
parentProperly raise an exception when the body exceeds the max size. (#9145) (diff)
downloadsynapse-53f6ab1c340fbe9d36945ebb1f24d129a9e6d13a.tar.xz
Merge commit '2b467d0b6' into anoa/dinsic_release_1_31_0
Diffstat (limited to '')
-rw-r--r--synapse/http/client.py2
-rw-r--r--synapse/http/matrixfederationclient.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py

index 4e5ef106a0..8eb93ba73e 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py
@@ -722,7 +722,7 @@ class SimpleHttpClient: read_body_with_max_size(response, output_stream, max_size) ) except BodyExceededMaxSize: - SynapseError( + raise SynapseError( 502, "Requested file is too large > %r bytes" % (max_size,), Codes.TOO_LARGE, diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py
index b7103d6541..19293bf673 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py
@@ -996,7 +996,7 @@ class MatrixFederationHttpClient: logger.warning( "{%s} [%s] %s", request.txn_id, request.destination, msg, ) - SynapseError(502, msg, Codes.TOO_LARGE) + raise SynapseError(502, msg, Codes.TOO_LARGE) except Exception as e: logger.warning( "{%s} [%s] Error reading response: %s",