Mercurial > prosody-modules
diff mod_slack_webhooks/mod_slack_webhooks.lua @ 3096:420391fd56e5
mod_slack_webhooks: Fix handling of form-urlencoded
This had to be incorrect as there can’t be nested keys in urlencoded
form data and the return value is treated as a table later
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 03 Jun 2018 01:31:40 +0200 |
parents | 3a6a48b83b4f |
children | c7f4e3987ed0 |
line wrap: on
line diff
--- a/mod_slack_webhooks/mod_slack_webhooks.lua Sat Jun 02 15:00:27 2018 +0200 +++ b/mod_slack_webhooks/mod_slack_webhooks.lua Sun Jun 03 01:31:40 2018 +0200 @@ -95,7 +95,7 @@ local body_type = headers.content_type; local post_body; if body_type == "application/x-www-form-urlencoded" then - post_body = formdecode(request.body)["payload"]; + post_body = formdecode(request.body); elseif body_type == "application/json" then if not pcall(function() post_body = json.decode(request.body) end) then return 420;