diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-29 07:20:33 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-29 07:21:23 +0200 |
commit | a9a3defba5767e29aeb3d3585e9f5e4f957b14b6 (patch) | |
tree | a53a7ae208f2a5cfaab78b4e9d755d3c5f3c267f | |
parent | 24fd5dc7ca43702a0222298c39b5d09ddcf93a8e (diff) |
feat(stream): raise exception if there's bare text in <features>
-rw-r--r-- | lib/stream.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/stream.ml b/lib/stream.ml index 0b6763a..218cc37 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -14,6 +14,12 @@ let parse_features (el : Xml.element) : features = let open Xml in let open Either in + let children = + if not (List.for_all is_left el.children) + then raise (InvalidStanza (element_to_string el)) + else List.filter_map find_left el.children + in + let parse_single_mechanism = function | Left {local_name = "mechanism"; children = [Right mechanism]; _} -> Sasl.parse_auth_mechanism mechanism |