#1496 PubSub/PEP should return a proper error for payload-less publish
Reporter
Jonas Schäfer
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Milestone-0.11
Status-Fixed
Type-Defect
Priority-Medium
Jonas Schäfer
on
What steps will reproduce the problem?
1. Set up a server with a PubSub service (e.g. by loading pep)
2. Publish a PubSub item without any payload
What is the expected output?
A proper bad-request error with invalid-payload application-specific condition.
What do you see instead?
internal-server-error.
What version of the product are you using? On what operating system?
name='Prosody' version='0.11.2' os='Linux' (Debian stable)
Please provide any additional information below.
Reproducer IQ:
<iq to="accountjid" type="set">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="testnode">
<item/>
</publish>
</pubsub>
</iq>
Thanks for the report.
mod_pep and mod_pubsub both have a callback responsible for
ensuring that the item really is an <item> with the correct xmlns.
I'm adding a check for the correct number of child tags here,
which should fix this this.
What steps will reproduce the problem? 1. Set up a server with a PubSub service (e.g. by loading pep) 2. Publish a PubSub item without any payload What is the expected output? A proper bad-request error with invalid-payload application-specific condition. What do you see instead? internal-server-error. What version of the product are you using? On what operating system? name='Prosody' version='0.11.2' os='Linux' (Debian stable) Please provide any additional information below. Reproducer IQ: <iq to="accountjid" type="set"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <publish node="testnode"> <item/> </publish> </pubsub> </iq>
I filed https://github.com/xsf/xeps/pull/898 to make the wording in XEP-0060 clear.
Thanks for the report. mod_pep and mod_pubsub both have a callback responsible for ensuring that the item really is an <item> with the correct xmlns. I'm adding a check for the correct number of child tags here, which should fix this this.
ChangesBorked tagging
ChangesFixed in https://hg.prosody.im/0.11/rev/657e61531b33
Changes