Procházet zdrojové kódy

Returns error when there is no query, but params expected.

master
damencho před 8 roky
rodič
revize
64bb5563bc

+ 8
- 0
resources/prosody-plugins/mod_muc_poltergeist.lua Zobrazit soubor

@@ -169,6 +169,10 @@ end, -100);
169 169
 -- @param event the http event, holds the request query
170 170
 -- @return GET response, containing a json with response details
171 171
 function handle_create_poltergeist (event)
172
+    if (not event.request.url.query) then
173
+        return 400;
174
+    end
175
+
172 176
     local params = parse(event.request.url.query);
173 177
     local user_id = params["user"];
174 178
     local room_name = params["room"];
@@ -194,6 +198,10 @@ end
194 198
 -- @param event the http event, holds the request query
195 199
 -- @return GET response, containing a json with response details
196 200
 function handle_update_poltergeist (event)
201
+    if (not event.request.url.query) then
202
+        return 400;
203
+    end
204
+
197 205
     local params = parse(event.request.url.query);
198 206
     local user_id = params["user"];
199 207
     local room_name = params["room"];

+ 8
- 0
resources/prosody-plugins/mod_muc_size.lua Zobrazit soubor

@@ -72,6 +72,10 @@ end
72 72
 -- @return GET response, containing a json with participants count,
73 73
 --         tha value is without counting the focus.
74 74
 function handle_get_room_size(event)
75
+    if (not event.request.url.query) then
76
+        return 400;
77
+    end
78
+
75 79
 	local params = parse(event.request.url.query);
76 80
 	local room_name = params["room"];
77 81
 	local domain_name = params["domain"];
@@ -121,6 +125,10 @@ end
121 125
 -- @param event the http event, holds the request query
122 126
 -- @return GET response, containing a json with participants details
123 127
 function handle_get_room (event)
128
+    if (not event.request.url.query) then
129
+        return 400;
130
+    end
131
+
124 132
 	local params = parse(event.request.url.query);
125 133
 	local room_name = params["room"];
126 134
 	local domain_name = params["domain"];

Načítá se…
Zrušit
Uložit