🐛 (webhook) Don't send body when GET method is used
This commit is contained in:
@ -10,6 +10,7 @@ import {
|
|||||||
WebhookOptions,
|
WebhookOptions,
|
||||||
WebhookResponse,
|
WebhookResponse,
|
||||||
WebhookBlock,
|
WebhookBlock,
|
||||||
|
HttpMethod,
|
||||||
} from 'models'
|
} from 'models'
|
||||||
import { parseVariables } from 'bot-engine'
|
import { parseVariables } from 'bot-engine'
|
||||||
import { NextApiRequest, NextApiResponse } from 'next'
|
import { NextApiRequest, NextApiResponse } from 'next'
|
||||||
@ -150,7 +151,8 @@ export const executeWebhook =
|
|||||||
? body
|
? body
|
||||||
: undefined,
|
: undefined,
|
||||||
form: contentType === 'x-www-form-urlencoded' && body ? body : undefined,
|
form: contentType === 'x-www-form-urlencoded' && body ? body : undefined,
|
||||||
body: body && !isJson ? body : undefined,
|
body:
|
||||||
|
body && !isJson && webhook.method !== HttpMethod.GET ? body : undefined,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const response = await got(request.url, omit(request, 'url'))
|
const response = await got(request.url, omit(request, 'url'))
|
||||||
|
Reference in New Issue
Block a user