feat(CaptchaHandler): Must not use due to safety concerns
This commit is contained in:
@@ -34,7 +34,7 @@ class APIRequest {
|
||||
this.path = `${path}${queryString && `?${queryString}`}`;
|
||||
}
|
||||
|
||||
make() {
|
||||
make(captchaKey = undefined) {
|
||||
agent ??=
|
||||
typeof this.client.options.proxy === 'string' && this.client.options.proxy.length > 0
|
||||
? new proxy(this.client.options.proxy)
|
||||
@@ -101,6 +101,12 @@ class APIRequest {
|
||||
headers = Object.assign(headers, body.getHeaders());
|
||||
}
|
||||
|
||||
if (headers['Content-Type'] === 'application/json' && captchaKey && typeof captchaKey == 'string' && body) {
|
||||
body = JSON.parse(body);
|
||||
body.captcha_key = captchaKey;
|
||||
body = JSON.stringify(body);
|
||||
}
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), this.client.options.restRequestTimeout).unref();
|
||||
return fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user