Annotate

spec/scansion/issue1121.scs @ 12790:24b55f0e2db9 0.12

mod_http: Allow disabling CORS in the http_cors_override option and by default Fixes #1779. Due to an oversight in the logic, if the user set 'enabled' to false in an override, it would disable the item's requested CORS settings, but still apply Prosody's default CORS policy. This change ensures that 'enabled = false' will now disable CORS entirely for the requested item. Due to the new structure of the code, it was necessary to have a flag to say whether CORS is to be applied at all. Rather than hard-coding 'true' here, I chose to add a new option: 'http_default_cors_enabled'. This is a boolean that allows the operator to disable Prosody's default CORS policy entirely (the one that is used when a module or config does not override it). This makes it easier to disable CORS and then selectively enable it only on services you want it on.
author Matthew Wild <mwild1@gmail.com>
date Mon, 31 Oct 2022 14:32:02 +0000
parent 12100:0b14b541fd27
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12100
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
1 # When removing roster contact, Prosody should send directed "unavailable" presence but sends global unavailable presence
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
2
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
3 [Client] Romeo
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
4 jid: romeo@localhost
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
5 password: password
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
6
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
7 [Client] Juliet
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
8 jid: juliet@localhost
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
9 password: password
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
10
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
11 -----
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
12
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
13 Romeo connects
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
14
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
15 Romeo sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
16 <presence/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
17
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
18 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
19 <presence from="${Romeo's full JID}"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
20
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
21 Juliet connects
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
22
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
23 Juliet sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
24 <presence/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
25
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
26 Juliet receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
27 <presence from="${Juliet's full JID}"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
28
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
29 Romeo sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
30 <presence to="juliet@localhost" type="subscribe"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
31
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
32 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
33 <presence from="juliet@localhost" to="romeo@localhost"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
34
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
35 Juliet receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
36 <presence from="romeo@localhost" to="juliet@localhost" type="subscribe"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
37
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
38 Juliet sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
39 <presence to="romeo@localhost" type="subscribed"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
40
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
41 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
42 <presence from="${Juliet's full JID}" to="romeo@localhost"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
43
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
44 Juliet sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
45 <presence to="romeo@localhost" type="subscribe"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
46
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
47 Juliet receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
48 <presence from="romeo@localhost" to="juliet@localhost"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
49
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
50 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
51 <presence from="juliet@localhost" to="romeo@localhost" type="subscribe"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
52
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
53 Romeo sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
54 <presence to="juliet@localhost" type="subscribed"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
55
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
56 Juliet receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
57 <presence from="${Romeo's full JID}" to="juliet@localhost"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
58
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
59 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
60 <presence from="${Juliet's full JID}" to="romeo@localhost"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
61
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
62 Juliet sends
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
63 <iq type="set" id="iq1">
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
64 <query xmlns="jabber:iq:roster">
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
65 <item jid="romeo@localhost" subscription="remove"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
66 </query>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
67 </iq>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
68
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
69 Juliet receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
70 <iq type="result" id="iq1"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
71
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
72 Romeo receives
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
73 <presence from="${Juliet's full JID}" to="romeo@localhost" type="unavailable"/>
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
74
0b14b541fd27 mod_roster: pass correct username to roster-item-removed
Jonas Schäfer <jonas@wielicki.name>
parents:
diff changeset
75 Romeo disconnects