[jdev] Necessity of stringprep support for the client

Waqas Hussain waqas20 at gmail.com
Mon Aug 20 11:17:53 UTC 2012

On Sun, Aug 19, 2012 at 1:35 PM, Kevin Smith <kevin at kismith.co.uk> wrote:
> On Sun, Aug 19, 2012 at 4:29 AM, Waqas Hussain <waqas20 at gmail.com> wrote:
>> 3. Stanzas
>> The server gives you back a <jid-malformed/> error. What more do you need?
> For sending, yes - but you also need to be comparing JIDs that you
> receive, and you need to prep them before comparison.
> Let's say you send an iq to=someunpreppedJID. You receive an iq
> result, you check the ID matches - it does, you check the from matches
> the to you sent - it doesn't, you bin the stanza as unsolicited.
> Except had you prepped the to/from before comparison you'd have found
> a match.
> If clients don't prep there's the chance for assorted things to get
> broken in interesting ways.
> /K

Agreed. Normalization is required before JID comparisons or lookups.
The question is how. My preferences in order are: 1) a client side
library, 2) an in-band service, 3) an out-of-band service.

I'd very much like the idea of a Javascript library explored. The
client having to call the server back on every single stanza (or less
with caching, but still), is suboptimal to say the least.

Waqas Hussain

More information about the JDev mailing list