Reply with service-unavailable for unhandled IQ requests

instead of feature-not-implemented.

Changes to send service-unavailable for not handled iq as said in
RFC6120 § 8.4: https://tools.ietf.org/html/rfc6120#page-128

"""
o  If an intended recipient receives an IQ stanza of type "get" or
   "set" containing a child element qualified by a namespace it does
   not understand, then the entity MUST return an IQ stanza of type
   "error" with an error condition of <service-unavailable/>.
"""
This commit is contained in:
damencho 2015-12-05 22:31:44 -06:00 committed by Florian Schmaus
parent f3817d6358
commit 035bbea837
1 changed files with 2 additions and 2 deletions

View File

@ -1049,9 +1049,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
return;
}
// If the IQ stanza is of type "get" or "set" with no registered IQ request handler, then answer an
// IQ of type "error" with code 501 ("feature-not-implemented")
// IQ of type 'error' with condition 'service-unavailable'.
ErrorIQ errorIQ = IQ.createErrorResponse(iq, new XMPPError(
XMPPError.Condition.feature_not_implemented));
XMPPError.Condition.service_unavailable));
try {
sendStanza(errorIQ);
}