Skip to content
Snippets Groups Projects
Commit 585046a6 authored by bruno-rocha-movile's avatar bruno-rocha-movile
Browse files

Only unwrapping webhook payloads if necessary

parent 13549d96
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,12 @@ Api = new Restivus
apiPath: 'hooks/'
auth:
user: ->
payloadKeys = Object.keys @bodyParams
payloadIsWrapped = @bodyParams?.payload? and payloadKeys.length == 1
if payloadIsWrapped and @request.headers['content-type'] is 'application/x-www-form-urlencoded'
@bodyParams = @bodyParams.payload
@integration = RocketChat.models.Integrations.findOne
_id: @request.params.integrationId
token: decodeURIComponent @request.params.token
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment