mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 12:44:58 -04:00
Discard an empty upload_name before persisting an uploaded file (#7905)
This commit is contained in:
parent
e154f7ccb5
commit
c2bdf040aa
3 changed files with 9 additions and 3 deletions
|
@ -63,6 +63,10 @@ class UploadResource(DirectServeJsonResource):
|
|||
msg="Invalid UTF-8 filename parameter: %r" % (upload_name), code=400
|
||||
)
|
||||
|
||||
# If the name is falsey (e.g. an empty byte string) ensure it is None.
|
||||
else:
|
||||
upload_name = None
|
||||
|
||||
headers = request.requestHeaders
|
||||
|
||||
if headers.hasHeader(b"Content-Type"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue