Skip to content

RateLimitException contains wrong reset/limit and remaining information #527

@alexz75

Description

@alexz75

In case RateLimitException thrown it contains only -1 values for limit, remaing and reset

Running applications using management api to get a big amout of the information from auth0. Getting RateLimitException as expected, but it not contains proper information.

No workaround, cannot retry the requests

I've found that the server returns response headers in lower case, but the client is expecting it in different form (BaseRequest):

private RateLimitException createRateLimitException(Auth0HttpResponse response) {
        // -1 as default value if the header could not be found.
        long limit = Long.parseLong(response.getHeader("X-RateLimit-Limit", "-1"));
        long remaining = Long.parseLong(response.getHeader("X-RateLimit-Remaining", "-1"));
        long reset = Long.parseLong(response.getHeader("X-RateLimit-Reset", "-1"));
        return new RateLimitException(limit, remaining, reset);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug reportThis issue reports a suspect bug or issue with the SDK itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions