diff options
author | xengineering <me@xengineering.eu> | 2023-07-01 20:57:15 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-01 20:57:15 +0200 |
commit | 6e973cfabe17421748af51856351f83e9856d137 (patch) | |
tree | 1321563b28a7fc0c8b5748210e802986e965e595 | |
parent | 342364d134ad4bbf64b1d0f077fb74fd0d86b454 (diff) | |
download | limox-6e973cfabe17421748af51856351f83e9856d137.tar limox-6e973cfabe17421748af51856351f83e9856d137.tar.zst limox-6e973cfabe17421748af51856351f83e9856d137.zip |
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.
-rw-r--r-- | xmpp/encoder_decoder.go | 10 |
1 files 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) { |