From dc7f6840bca5c8a2fb2e9748aed7ec0f04823ea2 Mon Sep 17 00:00:00 2001 From: jmatsuok Date: Tue, 14 Jan 2025 11:38:47 -0500 Subject: [PATCH] Fix location header --- src/main/java/io/cryostat/reports/Reports.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/cryostat/reports/Reports.java b/src/main/java/io/cryostat/reports/Reports.java index 83270eca3..b7b7eea76 100644 --- a/src/main/java/io/cryostat/reports/Reports.java +++ b/src/main/java/io/cryostat/reports/Reports.java @@ -103,11 +103,7 @@ public Response get(HttpServerResponse response, @RestPath String encodedKey) { return Response.ok(request.getId(), MediaType.TEXT_PLAIN) .status(202) .location( - UriBuilder.fromUri( - String.format( - "/api/v4/targets/%d/reports/%d", - pair.getLeft(), pair.getRight())) - .build()) + UriBuilder.fromUri(String.format("/api/v4/reports/%s", encodedKey)).build()) .build(); } @@ -129,7 +125,9 @@ public Response getActive( // Check if we've already cached a result for this report, return it if so if (reportsService.keyExists(recording)) { - return Response.ok(reportsService.reportFor(recording).await().atMost(timeout)) + return Response.ok( + reportsService.reportFor(recording).await().atMost(timeout), + MediaType.APPLICATION_JSON) .status(200) .build(); }