This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
500 Internal Server error if uploading without Content-Length #5114
Labels
A-Validation
500 (mostly) errors due to lack of event/parameter validation
z-bug
(Deprecated Label)
z-p2
(Deprecated Label)
Description
If the API
/_matrix/media/{apiVersion}/upload
is called without aContent-Length
header set, Synapse will throw an internal server error as it tries to access the header value without verifying that it exists first.Relevant message in #matrix-dev:matrix.org
Steps to reproduce
curl -X POST --insecure "http://localhost:8008/_matrix/media/r0/upload?filename=test.txt
Expected behaviour
Synapse responds with some kind of 4xx client failure telling me i need to provide data and relevant headers.
Actual behaviour
Synapse responds with a 500 Internal Server Error.
Log/stacktrace
Version information
If not matrix.org:
Version: 0.99.3
Install method: pip
The text was updated successfully, but these errors were encountered: