Skip to content

Commit 26c3a6d

Browse files
committed
add a byte of headroom to max size to account for >=
1 parent 94d9617 commit 26c3a6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

synapse/http/matrixfederationclient.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,8 @@ async def get_file(
15021502
raise SynapseError(HTTPStatus.TOO_MANY_REQUESTS, msg, Codes.LIMIT_EXCEEDED)
15031503

15041504
try:
1505-
d = read_body_with_max_size(response, output_stream, expected_size)
1505+
# add a byte of headroom to max size as function errs at >=
1506+
d = read_body_with_max_size(response, output_stream, expected_size + 1)
15061507
d.addTimeout(self.default_timeout_seconds, self.reactor)
15071508
length = await make_deferred_yieldable(d)
15081509
except BodyExceededMaxSize:

0 commit comments

Comments
 (0)