Misc Webhooks Fixes (#12038)

* fix(webhooks): don t parse response as json

* upgrade got to version 10

* remove old header

* fix tests

* fix email auth

* add migration

* update email error

* split migration in two
This commit is contained in:
Matteo Pagliazzi
2020-04-02 21:48:47 +02:00
committed by GitHub
parent e92ff9737a
commit 28bc843779
9 changed files with 326 additions and 87 deletions

View File

@@ -13,10 +13,10 @@ function sendWebhook (webhook, body, user) {
const { url, lastFailureAt } = webhook;
got.post(url, {
body,
json: true,
json: body,
timeout: 30000, // wait up to 30s before timing out
retry: 3, // retry the request up to 3 times
// Not calling .json() to parse the response because we simply ignore it
}).catch(webhookErr => {
// Log the error
logger.error(webhookErr, 'Error while sending a webhook request.');