Skip to content

Commit 53bd09e

Browse files
committed
Mailbox does not accept empty requests any more. Closes #7
1 parent c64ee15 commit 53bd09e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

usr/lib/lua/luci/controller/arduino/index.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,9 @@ local function build_bridge_request(command, params)
575575
}
576576

577577
if command == "raw" then
578-
if not_nil_or_empty(params[1]) then
579-
bridge_request["data"] = params[1]
578+
params = table.concat(params, "/")
579+
if not_nil_or_empty(params) then
580+
bridge_request["data"] = params
580581
end
581582
return bridge_request
582583
end
@@ -794,7 +795,11 @@ function build_bridge_mailbox_request()
794795
end
795796
end
796797

797-
-- TODO check method?
798+
if #params == 0 then
799+
luci.http.status(400)
800+
return
801+
end
802+
798803
local bridge_request = build_bridge_request("raw", params)
799804
if not bridge_request then
800805
luci.http.status(403)

0 commit comments

Comments
 (0)