aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_xml_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-02-04 20:47:39 +0100
committerKim Alvefur <zash@zash.se>2022-02-04 20:47:39 +0100
commit99a880ebe5e45655d63e1a72866d2d44b7497fd9 (patch)
tree650d8f0ddbdcf64d4d490a0f965e8f952b989c3a /spec/util_xml_spec.lua
parenteae775bc79c9c2a771212eedcdd7389b993078f0 (diff)
downloadprosody-99a880ebe5e45655d63e1a72866d2d44b7497fd9.tar.gz
prosody-99a880ebe5e45655d63e1a72866d2d44b7497fd9.zip
util.xml: Add an option to allow <?processing instructions?>
These should generally be safe to just ignore, which should be the default behavior of Expat and LuaExpat
Diffstat (limited to 'spec/util_xml_spec.lua')
-rw-r--r--spec/util_xml_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/util_xml_spec.lua b/spec/util_xml_spec.lua
index 28a1cea7..6d3136ab 100644
--- a/spec/util_xml_spec.lua
+++ b/spec/util_xml_spec.lua
@@ -42,6 +42,13 @@ describe("util.xml", function()
assert.falsy(ok);
end);
+ it("should allow processing instructions if asked nicely", function()
+ local x = "<?xml-stylesheet href='make-fancy.xsl'?><foo/>";
+ local stanza = xml.parse(x, {allow_processing_instructions = true});
+ assert.truthy(stanza);
+ assert.are.equal(stanza.name, "foo");
+ end);
+
it("should allow an xml declaration", function()
local x = "<?xml version='1.0'?><foo/>";
local stanza = xml.parse(x);