From 6e973cfabe17421748af51856351f83e9856d137 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 1 Jul 2023 20:57:15 +0200 Subject: Drop xml.{ProcInst,Directive,Comment} LimoX does not care about these XML tokens at least for now. The issued error messages on other levels. Dropping those tokens on the encoderDecoder level asserts that the rest of the xmpp code has only `clean` XML content to process. --- xmpp/encoder_decoder.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xmpp/encoder_decoder.go b/xmpp/encoder_decoder.go index d7951b3..b0ea77b 100644 --- a/xmpp/encoder_decoder.go +++ b/xmpp/encoder_decoder.go @@ -59,8 +59,14 @@ func (ed *encoderDecoder) run() { default: t, err := ed.rx.Token() if t != nil && err == nil { - c := xml.CopyToken(t) - ed.session.rx <- c + switch t.(type) { + case xml.ProcInst: + case xml.Directive: + case xml.Comment: + default: + c := xml.CopyToken(t) + ed.session.rx <- c + } } if err != nil { if errors.Is(err, io.EOF) { -- cgit v1.2.3-70-g09d2