Skip to content

Commit

Permalink
Fix location header
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Matsuoka committed Jan 14, 2025
1 parent 28ca18d commit 7c24bdc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/io/cryostat/reports/Reports.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
}
Expand Down

0 comments on commit 7c24bdc

Please sign in to comment.