plugin XEP-0166: reject session creation is session ID is empty
This commit is contained in:
parent
0e6dd6a8de
commit
71cfdccb5b
1 changed files with 4 additions and 0 deletions
|
|
@ -184,6 +184,10 @@ class XEP_0166:
|
|||
@raise ValueError: If the provided role is neither initiator nor responder.
|
||||
"""
|
||||
# TODO: session cleaning after timeout ?
|
||||
|
||||
if not sid:
|
||||
raise exceptions.DataError("Empty session ID is not allowed")
|
||||
|
||||
if role not in [XEP_0166.ROLE_INITIATOR, XEP_0166.ROLE_RESPONDER]:
|
||||
raise ValueError(f"Invalid role {role}. Expected initiator or responder.")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue