Skip to content

URLBuilder should url-encode RFC3339 formatted dates #889

@sfurholm

Description

@sfurholm

Description
DeleteTasksQuery using any of the java.util.Date arguments (beforeEnqueuedAt, afterEnqueuedAt, beforeStartedAt, afterStartedAt, beforeFinishedAt, afterFinishedAt) fail on systems east of UTC, as the time zone offset when converted to an RFC3339 formatted String in URLBuilder will have a + in it, which ends up being translated to a space by Meilisearch when passed in the URL, resulting in Meilisearch returning a 400 Bad Request. URLBuilder should url-encode the RFC3339 formatted String.

Expected behavior
URLBuilder should url-encode the RFC3339 formatted String.

Current behavior
The + that will appear with a positive time zone offset when java.util.Date is converted to an RFC3339 String isn't url-encoded, and ends up being interpreted as a space.

Screenshots or Logs
tcpdump of request:

DELETE /tasks?statuses=succeeded&beforeFinishedAt=2025-09-10T23:34:27+02:00 HTTP/1.1
Authorization: Bearer {redacted}
User-Agent: Meilisearch Java (v0.15.0)
Content-Length: 0
Host: 127.0.0.1:34255
Connection: Keep-Alive
Accept-Encoding: gzip

Response:

HTTP/1.1 400 Bad Request
transfer-encoding: chunked
content-type: application/json
vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers
vary: accept-encoding
content-encoding: gzip
date: Thu, 11 Sep 2025 21:34:27 GMT

Environment (please complete the following information):

  • OS: MacOS 15.5
  • Meilisearch version: v.1.17.1
  • meilisearch-java version: v0.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions