From adf9267905eeda44a32123e5b54414b3b14a220c Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 16 May 2024 13:59:53 +0600 Subject: [PATCH] api: expose rate limit headers --- src/core/api.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/api.js b/src/core/api.js index 686414af..c5110a05 100644 --- a/src/core/api.js +++ b/src/core/api.js @@ -53,7 +53,13 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) { app.use('/api', cors({ methods: ['GET', 'POST'], - ...corsConfig + exposedHeaders: [ + 'Ratelimit-Limit', + 'Ratelimit-Policy', + 'Ratelimit-Remaining', + 'Ratelimit-Reset' + ], + ...corsConfig, })) app.use('/api/json', apiLimiter);