Software /
code /
prosody
File
certs/localhost.cnf @ 11476:83e127eb91f9
util.datamapper: Deal with locally built stanzas missing xmlns
So the problem is that xmlns is not inherited when building a stanza,
and then :get_child(n, ns) with an explicit namespace does not find that
such child tags.
E.g.
local t = st.stanza("foo", { xmlns = "urn:example:bar" })
:text_tag("hello", "world");
assert(t:get_child("hello", "urn:example:bar"), "This fails");
Meanwhile, during parsing (util.xmppstream or util.xml) child tags do
get the parents xmlns when not overriding them.
Thus, in the above example, if the stanza is passed trough
`t = util.xml.parse(tostring(t))` then the assert succeeds.
This change makes it so that it leaves out the namespace argument to
:get_child when it is the same as the current/parent namespace, which
behaves the same for both built and parsed stanzas.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 23 Mar 2021 19:52:59 +0100 |
parent | 7693:93c041d5bb0b |
line wrap: on
line source
[v3_extensions] basicConstraints = CA:TRUE subjectAltName = @subject_alternative_name [subject_alternative_name] DNS.0 = localhost otherName.0 = 1.3.6.1.5.5.7.8.7;IA5STRING:_xmpp-client.localhost otherName.1 = 1.3.6.1.5.5.7.8.7;IA5STRING:_xmpp-server.localhost otherName.2 = 1.3.6.1.5.5.7.8.5;FORMAT:UTF8,UTF8:localhost [distinguished_name] countryName = GB organizationName = Prosody IM organizationalUnitName = https://prosody.im/doc/certificates commonName = Example certificate [req] prompt = no x509_extensions = v3_extensions req_extensions = v3_extensions distinguished_name = distinguished_name