Mercurial > prosody-modules
annotate mod_compat_vcard/mod_compat_vcard.lua @ 5513:0005d4201030
mod_http_oauth2: Reject duplicate form-urlencoded parameters
Per RFC 6749 section 3.1
> Request and response parameters MUST NOT be included more than once.
Thanks to OAuch for pointing out
Also cleans up some of the icky behavior of formdecode(), like returning
a string if no '=' is included.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 02 Jun 2023 11:03:57 +0200 |
parents | 3df303543765 |
children |
rev | line source |
---|---|
749
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 -- Compatibility with clients and servers (i.e. ejabberd) that send vcard |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 -- requests to the full JID |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 -- |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 -- https://support.process-one.net/browse/EJAB-1045 |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 local jid_bare = require "util.jid".bare; |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 local st = require "util.stanza"; |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 local core_process_stanza = prosody.core_process_stanza; |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 module:hook("iq/full", function(event) |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 local stanza = event.stanza; |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 local payload = stanza.tags[1]; |
1297
3df303543765
mod_compat_vcard: Fix traceback from probably empty stanzas (Thanks Biszkopcik)
Kim Alvefur <zash@zash.se>
parents:
749
diff
changeset
|
13 if payload and stanza.attr.type == "get" and payload.name == "vCard" and payload.attr.xmlns == "vcard-temp" then |
749
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 local fixed_stanza = st.clone(event.stanza); |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 fixed_stanza.attr.to = jid_bare(stanza.attr.to); |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 core_process_stanza(event.origin, fixed_stanza); |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 return true; |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 end |
1a7cdc874b8c
mod_compat_vcard: Handle vcard requests sent to full JIDs (a spec violation commited by older versions of ejabberd and possibly others) - replaces vcard_compatibility option from Prosody 0.8
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 end, 1); |