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

This commit is contained in:
damencho 2017-07-17 17:38:29 -05:00
parent 0cffbdb967
commit 64bb5563bc
2 changed files with 16 additions and 0 deletions

View File

@ -169,6 +169,10 @@ end, -100);
-- @param event the http event, holds the request query
-- @return GET response, containing a json with response details
function handle_create_poltergeist (event)
if (not event.request.url.query) then
return 400;
end
local params = parse(event.request.url.query);
local user_id = params["user"];
local room_name = params["room"];
@ -194,6 +198,10 @@ end
-- @param event the http event, holds the request query
-- @return GET response, containing a json with response details
function handle_update_poltergeist (event)
if (not event.request.url.query) then
return 400;
end
local params = parse(event.request.url.query);
local user_id = params["user"];
local room_name = params["room"];

View File

@ -72,6 +72,10 @@ end
-- @return GET response, containing a json with participants count,
-- tha value is without counting the focus.
function handle_get_room_size(event)
if (not event.request.url.query) then
return 400;
end
local params = parse(event.request.url.query);
local room_name = params["room"];
local domain_name = params["domain"];
@ -121,6 +125,10 @@ end
-- @param event the http event, holds the request query
-- @return GET response, containing a json with participants details
function handle_get_room (event)
if (not event.request.url.query) then
return 400;
end
local params = parse(event.request.url.query);
local room_name = params["room"];
local domain_name = params["domain"];