Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API endpoints that have CORS headers, should also have Access-Control-Expose-Headers: Ratelimit-Remaining, ... so client can read rate limit header(s) #3217

Open
josephrocca opened this issue Dec 10, 2024 · 0 comments · May be fixed by #3491

Comments

@josephrocca
Copy link

Is your feature request related to a problem? Please describe.

When creating a JS script script for a bookmarklet, I noticed that I wasn't able to read rate-limit headers. I learned that it's because the browser requires the server to explicitly allow reading all but a standard set of headers for security:

Describe the solution you'd like

In all places that Access-Control-Allow-Origin: * is added to responses, we should also add this header:

Access-Control-Expose-Headers: Ratelimit-Limit, Ratelimit-Policy, Ratelimit-Remaining, Ratelimit-Reset

to allow browser-based clients to read rate limit headers.

Describe alternatives you've considered

Wait for 429 response code, then exponential back-off. Or similar.

@mary-ext mary-ext linked a pull request Feb 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant