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

Expose Labrinth Response Headers via CORS #972

Open
IsAvaible opened this issue Oct 3, 2024 · 0 comments
Open

Expose Labrinth Response Headers via CORS #972

IsAvaible opened this issue Oct 3, 2024 · 0 comments
Labels
enhancement For issues suggesting enhancements to existing features

Comments

@IsAvaible
Copy link

Is your suggested enhancement related to a problem? Please describe.

Dear Dev Team,

I am the developer of a web-based update checker that heavily relies on the Modrinth API. Some users of my application attempt to update a large number of mods simultaneously (~150+), which frequently triggers rate limiting by the API.

The issue I'm facing is that when the rate limiting occurs, the required CORS headers are not included in the response (as outlined in #874), and the Access-Control-Expose-Headers header is also not set. This makes it difficult to track important information such as the remaining tokens and time until reset from the API's headers.

To mitigate this, I have implemented a client-side method to track these values manually. However, this approach has proven to be inconsistent, resulting in unreliable functionality.

Describe the solution you'd like

To make web-based API wrappers more feasible and improve consistency, could you please include the Access-Control-Expose-Headers header in the API responses? Specifically, exposing the rate-limiting-related headers (e.g., X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) would allow developers like me to reliably manage rate limits on the client side.

Describe alternatives you've considered

No response

Additional context

image
As seen on the picture, the rate-limiting-related headers are included in the response, but I can't read them in my application due to CORS (only access-control-allow-origin is set).

Thank you for considering this request.

Best Regards
Simon

@IsAvaible IsAvaible added the enhancement For issues suggesting enhancements to existing features label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For issues suggesting enhancements to existing features
Development

No branches or pull requests

1 participant