@discordjs/rest 3.0.0-dev.1764720113-633fdd8f2 → 3.0.0-dev.1765065716-5e6bd4b3d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -19,12 +19,17 @@ __name(getDefaultStrategy, "getDefaultStrategy");
19
19
  import { STATUS_CODES } from "http";
20
20
  import { URLSearchParams as URLSearchParams2 } from "url";
21
21
  import { types } from "util";
22
- import { request, Headers, FormData as UndiciFormData } from "undici";
22
+ import { request, Headers, FormData as UndiciFormData, Agent } from "undici";
23
+ var localAgent = null;
23
24
  async function makeRequest(url, init) {
24
25
  const options = {
25
26
  ...init,
26
27
  body: await resolveBody(init.body)
27
28
  };
29
+ if (!options.dispatcher) {
30
+ localAgent ??= new Agent();
31
+ options.dispatcher = localAgent;
32
+ }
28
33
  const res = await request(url, options);
29
34
  return {
30
35
  body: res.body,
@@ -98,7 +103,7 @@ import { CDNRoutes } from "discord-api-types/v10";
98
103
  // src/lib/utils/constants.ts
99
104
  import { getUserAgentAppendix } from "@discordjs/util";
100
105
  import { APIVersion } from "discord-api-types/v10";
101
- var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.1764720113-633fdd8f2)`;
106
+ var DefaultUserAgent = `DiscordBot (https://discord.js.org, 3.0.0-dev.1765065716-5e6bd4b3d)`;
102
107
  var DefaultUserAgentAppendix = getUserAgentAppendix();
103
108
  var DefaultRestOptions = {
104
109
  agent: null,
@@ -1499,7 +1504,7 @@ var REST = class _REST extends AsyncEventEmitter {
1499
1504
  };
1500
1505
 
1501
1506
  // src/shared.ts
1502
- var version = "3.0.0-dev.1764720113-633fdd8f2";
1507
+ var version = "3.0.0-dev.1765065716-5e6bd4b3d";
1503
1508
 
1504
1509
  // src/index.ts
1505
1510
  setDefaultStrategy(shouldUseGlobalFetchAndWebSocket() ? fetch : makeRequest);