RESTEasy error 400 when query param contains curly braces

56 Views Asked by At

Say I have a simple REST endpoint

@GET
@Path("/hello")
@Produces(MediaType.TEXT_PLAIN)
public String greeting(@QueryParam(value = "name") String name) {
    return "Hello " + name;
}

If I call it, it works as expected:

request: GET http://localhost:8080/hello?name=foo
response: HTTP 200, body "Hello foo"

I can also pass encoded curly braces:

request: GET http://localhost:8080/hello?name=%7Bfoo%7D
response: HTTP 200, body "Hello {foo}"

However, if I put some (not encoded!) curly braces in parameter, I get a error 400 and I cannot see any exception, even with an ExceptionMapper configured.

request: GET http://localhost:8080/hello?name={foo}
response: HTTP 400, empty body

Why? How can I trap this kind of error?

Thank you.

0

There are 0 best solutions below