Skip to content

Commit

Permalink
bail after, not at, max size
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Jun 3, 2024
1 parent 94d9617 commit e2377b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion synapse/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ def dataReceived(self, data: bytes) -> None:
# The first time the maximum size is exceeded, error and cancel the
# connection. dataReceived might be called again if data was received
# in the meantime.
if self.max_size is not None and self.length >= self.max_size:
if self.max_size is not None and self.length > self.max_size:
self.deferred.errback(BodyExceededMaxSize())
# Close the connection (forcefully) since all the data will get
# discarded anyway.
Expand Down

0 comments on commit e2377b5

Please sign in to comment.