From c731c1e61f330eafbb942e9bf2cde1e6f056cd08 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Apr 2026 14:01:18 +0100 Subject: [PATCH] fix(discord): sync proxy request client with carbon --- extensions/discord/src/proxy-request-client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/discord/src/proxy-request-client.ts b/extensions/discord/src/proxy-request-client.ts index 18dfe2a2824..6d00add05cc 100644 --- a/extensions/discord/src/proxy-request-client.ts +++ b/extensions/discord/src/proxy-request-client.ts @@ -33,7 +33,7 @@ type Attachment = { description?: string; }; -const defaultOptions: Required> & { +const defaultOptions: Required> & { baseUrl: string; tokenHeader: "Bot" | "Bearer"; } = { @@ -242,6 +242,7 @@ class ProxyRequestClientCompat { .join("&")}` : ""; const url = `${this.options.baseUrl}${path}${queryString}`; + const originalRequest = new Request(url, { method }); const headers = this.token === "webhook" ? new Headers() @@ -332,7 +333,7 @@ class ProxyRequestClientCompat { if (response.status === 429) { const rateLimitBody = toRateLimitBody(parsedBody, rawBody, response.headers); - const rateLimitError = new RateLimitError(response, rateLimitBody); + const rateLimitError = new RateLimitError(response, rateLimitBody, originalRequest); this.scheduleRateLimit( routeKey, rateLimitError.retryAfter,