mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 04:42:16 -04:00
Improved validation for received requests (#9817)
* Simplify `start_listening` callpath * Correctly check the size of uploaded files
This commit is contained in:
parent
84936e2264
commit
3ff2251754
15 changed files with 174 additions and 31 deletions
|
@ -51,8 +51,6 @@ class UploadResource(DirectServeJsonResource):
|
|||
|
||||
async def _async_render_POST(self, request: SynapseRequest) -> None:
|
||||
requester = await self.auth.get_user_by_req(request)
|
||||
# TODO: The checks here are a bit late. The content will have
|
||||
# already been uploaded to a tmp file at this point
|
||||
content_length = request.getHeader("Content-Length")
|
||||
if content_length is None:
|
||||
raise SynapseError(msg="Request must specify a Content-Length", code=400)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue