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

Fix RateLimiter binding name #701

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxdeviant
Copy link

This PR fixes an issue where the RateLimiter could not be retrieved with Env::get_binding, as described in #700.

When trying to retrieve the rate limiter I was getting the following error:

Binding cannot be cast to the type RateLimiter from RateLimit

From what I can tell, the underlying issue is that the runtime constructor name is actually Ratelimit, based on this code here:

if obj.constructor().name() == Self::TYPE_NAME {

I was able to fix this by updating the type name from RateLimiter to Ratelimit in the EnvBinding impl.

If there is a different way this should be fixed, I am happy to pursue other avenues.

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 this pull request may close these issues.

1 participant