feat(Rest): expose https.Agent options (#6177)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Shino
2021-08-17 16:45:32 -04:00
committed by GitHub
parent 16493e65fd
commit 5eb3553fd1
3 changed files with 14 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ const FormData = require('@discordjs/form-data');
const fetch = require('node-fetch');
const { UserAgent } = require('../util/Constants');
const agent = new https.Agent({ keepAlive: true });
let agent = null;
class APIRequest {
constructor(rest, method, path, options) {
@@ -30,6 +30,8 @@ class APIRequest {
}
make() {
agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
const API =
this.options.versioned === false
? this.client.options.http.api