mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-16 01:33:34 -04:00
Allow bigger responses to /federation/v1/state
(#12877)
* Refactor HTTP response size limits Rather than passing a separate `max_response_size` down the stack, make it an attribute of the `parser`. * Allow bigger responses on `federation/v1/state` `/state` can return huge responses, so we need to handle that.
This commit is contained in:
parent
4660d9fdcf
commit
1b338476af
4 changed files with 19 additions and 32 deletions
|
@ -26,7 +26,7 @@ from twisted.web.http import HTTPChannel
|
|||
|
||||
from synapse.api.errors import RequestSendFailed
|
||||
from synapse.http.matrixfederationclient import (
|
||||
MAX_RESPONSE_SIZE,
|
||||
JsonParser,
|
||||
MatrixFederationHttpClient,
|
||||
MatrixFederationRequest,
|
||||
)
|
||||
|
@ -609,9 +609,9 @@ class FederationClientTests(HomeserverTestCase):
|
|||
while not test_d.called:
|
||||
protocol.dataReceived(b"a" * chunk_size)
|
||||
sent += chunk_size
|
||||
self.assertLessEqual(sent, MAX_RESPONSE_SIZE)
|
||||
self.assertLessEqual(sent, JsonParser.MAX_RESPONSE_SIZE)
|
||||
|
||||
self.assertEqual(sent, MAX_RESPONSE_SIZE)
|
||||
self.assertEqual(sent, JsonParser.MAX_RESPONSE_SIZE)
|
||||
|
||||
f = self.failureResultOf(test_d)
|
||||
self.assertIsInstance(f.value, RequestSendFailed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue