mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 17:56:19 +03:00
Don't require Content-Length header
This commit is contained in:
parent
a6670b7257
commit
9f2434d494
1 changed files with 8 additions and 9 deletions
|
@ -52,8 +52,7 @@ class UploadResource(DirectServeResource):
|
||||||
requester = await self.auth.get_user_by_req(request)
|
requester = await self.auth.get_user_by_req(request)
|
||||||
# TODO: The checks here are a bit late. The content will have
|
# TODO: The checks here are a bit late. The content will have
|
||||||
# already been uploaded to a tmp file at this point
|
# already been uploaded to a tmp file at this point
|
||||||
if not request.hasHeader(b"Content-Length"):
|
if request.hasHeader(b"Content-Length"):
|
||||||
raise SynapseError(msg="Request must specify a Content-Length", code=400)
|
|
||||||
content_length = request.getHeader(b"Content-Length").decode("ascii")
|
content_length = request.getHeader(b"Content-Length").decode("ascii")
|
||||||
if int(content_length) > self.max_upload_size:
|
if int(content_length) > self.max_upload_size:
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
|
|
Loading…
Reference in a new issue