mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(Rest): expose https.Agent options (#6177)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user