mirror of
https://github.com/discordjs/discord.js.git
synced 2026-09-17 08:47:27 +00:00
fix(proxyRequests): pass on ratelimit information
This commit is contained in:
@@ -50,6 +50,12 @@ export function populateGeneralErrorResponse(res: ServerResponse, error: Discord
|
||||
export function populateRatelimitErrorResponse(res: ServerResponse, error: RateLimitError): void {
|
||||
res.statusCode = 429;
|
||||
res.setHeader('Retry-After', error.timeToReset / 1_000);
|
||||
|
||||
if (error.global) {
|
||||
res.setHeader('X-RateLimit-Global', 'true');
|
||||
}
|
||||
|
||||
res.setHeader('X-RateLimit-Scope', error.scope);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user