auth0 / .github

Org-wide repository files.
https://github.blog/changelog/2019-02-21-organization-wide-community-health-files/
MIT License
3 stars 30 forks source link

ManagementAPI getLogEvents() is double encoding the LogEventFilter's withQuery() value #11

Closed CalebeGeazi closed 2 years ago

CalebeGeazi commented 2 years ago

Description

When building a LogEventFilter object that adds a date range query via the LogEventsFilter.withQuery() method, and then passing this object to the ManagementAPI getLogEvents() method the resulting q query string parameter is being double encoded. This is causing a 400 Bad Request error.

I would expect the query to only be URLEncoded once.

Reproduction

Here's the code snippet for setting the query parameter and making the getLogEvents() call:

LocalDate date = LocalDate.now().minus(Period.ofDays(30));
String query = "date:[" + date + " TO *]";
LogEventFilter filter = new LogEventFilter()
    .withQuery(query)
    .withPage(pageNumber, 10);

Request<LogEventsPage> request = managementApi.users().getLogEvents(userId, filter);
request.execute();

Environment