diff options
Diffstat (limited to 'packages/backend/src/core/CaptchaService.ts')
| -rw-r--r-- | packages/backend/src/core/CaptchaService.ts | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/packages/backend/src/core/CaptchaService.ts b/packages/backend/src/core/CaptchaService.ts index 1e98914052..c8428a26b0 100644 --- a/packages/backend/src/core/CaptchaService.ts +++ b/packages/backend/src/core/CaptchaService.ts @@ -21,18 +21,13 @@ export class CaptchaService { response, }); - const res = await this.httpRequestService.fetch( - url, - { - method: 'POST', - body: params, + const res = await this.httpRequestService.send(url, { + method: 'POST', + body: JSON.stringify(params), + headers: { + 'Content-Type': 'application/json', }, - { - noOkError: true, - } - ).catch(err => { - throw `${err.message ?? err}`; - }); + }, { throwErrorWhenResponseNotOk: false }); if (!res.ok) { throw `${res.status}`; |