component file sharing: forbid jingle upload by entities which are not in allowed hosts
This commit is contained in:
parent
3c12c4f797
commit
76392e9377
1 changed files with 3 additions and 0 deletions
|
|
@ -508,6 +508,9 @@ class FileSharing:
|
|||
"""This trigger accept file sending request, and store file locally"""
|
||||
if not client.is_component:
|
||||
return True, None
|
||||
# client._file_sharing_allowed_hosts is set in plugin XEP-0329
|
||||
if peer_jid.host not in client._file_sharing_allowed_hosts:
|
||||
raise error.StanzaError("forbidden")
|
||||
assert stream_object
|
||||
assert "stream_object" not in transfer_data
|
||||
assert C.KEY_PROGRESS_ID in file_data
|
||||
|
|
|
|||
Loading…
Reference in a new issue