Closed gbourant closed 1 month ago
Ouch, this is definitely a bug :(
I wonder where it lies…
Oh, perhaps because you didn't include the extention
(watch out there's a typo in your code, it should be extension
) in the endpoint parameter list?
I just tried (with correct spelling) and with a new RestPath "extension"
@Path("/p/pixel")
class PixelResource extends Controller {
@GET
@Path("{token}/{checksum}{extension: (\\.png)?}")
public Response pixel(@RestPath("token") UUID token, @RestPath("checksum") Integer checksum, @RestPath("extension") String extension ) {
return Response.ok().build();
}
}
and
Router.getAbsoluteURI(PixelResource::pixel, UUID.fromString("453f74a6-d1f1-4cca-9322-142f9f46df09"), 477258115 ,".png")
returns the same
http://localhost:8081/p/pixel/453f74a6-d1f1-4cca-9322-142f9f46df09/477258115%7Bextension:%20(%5C.png)?%7D
The new param is totally ignored, for example the result of Router.getAbsoluteURI(PixelResource::pixel, UUID.fromString("453f74a6-d1f1-4cca-9322-142f9f46df09"), 477258115 ,"SOME_RANDOM_DATA")
is the same as before http://localhost:8081/p/pixel/453f74a6-d1f1-4cca-9322-142f9f46df09/477258115%7Bextension:%20(%5C.png)?%7D
OK, it's a Quarkus REST bug, I'll report it upstream.
For the following controller
The falling call
Router.getAbsoluteURI(PixelResource::pixel, UUID.fromString("453f74a6-d1f1-4cca-9322-142f9f46df09"), 477258115)
returnshttp://localhost:8081/p/pixel/453f74a6-d1f1-4cca-9322-142f9f46df09/477258115%7Bextention:%20(%5C.png)?%7D
It adds the
%7Bextention:%20(%5C.png)?%7D
at the end.