Log method and path when dropping request due to size limit (#10091)

pull/10111/head
Erik Johnston 2021-05-28 15:57:53 +01:00 committed by GitHub
parent ac3e02d089
commit 3f96dbbda7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/10091.misc Normal file
View File

@ -0,0 +1 @@
Log method and path when dropping request due to size limit.

View File

@ -105,8 +105,10 @@ class SynapseRequest(Request):
assert self.content, "handleContentChunk() called before gotLength()"
if self.content.tell() + len(data) > self._max_request_body_size:
logger.warning(
"Aborting connection from %s because the request exceeds maximum size",
"Aborting connection from %s because the request exceeds maximum size: %s %s",
self.client,
self.get_method(),
self.get_redacted_uri(),
)
self.transport.abortConnection()
return