mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix a logcontext leak in the media repo
This commit is contained in:
parent
1de557975f
commit
d03cfc4258
@ -17,6 +17,7 @@ from synapse.http.server import respond_with_json, finish_request
|
|||||||
from synapse.api.errors import (
|
from synapse.api.errors import (
|
||||||
cs_error, Codes, SynapseError
|
cs_error, Codes, SynapseError
|
||||||
)
|
)
|
||||||
|
from synapse.util import logcontext
|
||||||
|
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.protocols.basic import FileSender
|
from twisted.protocols.basic import FileSender
|
||||||
@ -103,7 +104,9 @@ def respond_with_file(request, media_type, file_path,
|
|||||||
)
|
)
|
||||||
|
|
||||||
with open(file_path, "rb") as f:
|
with open(file_path, "rb") as f:
|
||||||
yield FileSender().beginFileTransfer(f, request)
|
yield logcontext.make_deferred_yieldable(
|
||||||
|
FileSender().beginFileTransfer(f, request)
|
||||||
|
)
|
||||||
|
|
||||||
finish_request(request)
|
finish_request(request)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user