🐛 (webhook) Don't send body when GET method is used
This commit is contained in:
@@ -132,13 +132,15 @@ export const executeWebhook =
|
||||
resultValues,
|
||||
groupId,
|
||||
})
|
||||
const { data: body, isJson } = bodyContent
|
||||
? safeJsonParse(
|
||||
parseVariables(variables, {
|
||||
escapeForJson: !checkIfBodyIsAVariable(bodyContent),
|
||||
})(bodyContent)
|
||||
)
|
||||
: { data: undefined, isJson: false }
|
||||
const { data: body, isJson } =
|
||||
bodyContent && webhook.method !== HttpMethod.GET
|
||||
? safeJsonParse(
|
||||
parseVariables(variables, {
|
||||
escapeForJson: !checkIfBodyIsAVariable(bodyContent),
|
||||
})(bodyContent)
|
||||
)
|
||||
: { data: undefined, isJson: false }
|
||||
|
||||
const request = {
|
||||
url: parseVariables(variables)(
|
||||
webhook.url + (queryParams !== '' ? `?${queryParams}` : '')
|
||||
@@ -151,8 +153,7 @@ export const executeWebhook =
|
||||
? body
|
||||
: undefined,
|
||||
form: contentType === 'x-www-form-urlencoded' && body ? body : undefined,
|
||||
body:
|
||||
body && !isJson && webhook.method !== HttpMethod.GET ? body : undefined,
|
||||
body: body && !isJson ? body : undefined,
|
||||
}
|
||||
try {
|
||||
const response = await got(request.url, omit(request, 'url'))
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "22.0.2",
|
||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
||||
"@rollup/plugin-typescript": "8.4.0",
|
||||
"rollup": "2.78.1",
|
||||
"@rollup/plugin-node-resolve": "^14.0.1",
|
||||
"@rollup/plugin-typescript": "8.5.0",
|
||||
"rollup": "2.79.0",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.8.2",
|
||||
"aws-sdk": "2.1204.0",
|
||||
"typescript": "^4.8.3",
|
||||
"aws-sdk": "2.1213.0",
|
||||
"models": "workspace:*",
|
||||
"next": "12.2.5"
|
||||
"next": "12.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"aws-sdk": "^2.1152.0",
|
||||
|
||||
Reference in New Issue
Block a user