From 2e8be96224e817da9df492fbf0d55dc99d801a83 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Wed, 14 Feb 2024 18:02:35 -0500 Subject: [PATCH] include content-type header --- src/main/java/io/cryostat/recordings/Recordings.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/io/cryostat/recordings/Recordings.java b/src/main/java/io/cryostat/recordings/Recordings.java index fa20908f5..0d3994a90 100644 --- a/src/main/java/io/cryostat/recordings/Recordings.java +++ b/src/main/java/io/cryostat/recordings/Recordings.java @@ -56,6 +56,7 @@ import io.cryostat.recordings.RecordingHelper.SnapshotCreationException; import io.cryostat.targets.Target; import io.cryostat.targets.TargetConnectionManager; +import io.cryostat.util.HttpMimeType; import io.cryostat.util.HttpStatusCodeIdentifier; import io.cryostat.ws.MessagingServer; import io.cryostat.ws.Notification; @@ -984,6 +985,7 @@ public Response handleActiveDownload(@RestPath long id) throws Exception { .header( HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=\"%s.jfr\"", recording.name)) + .header(HttpHeaders.CONTENT_TYPE, HttpMimeType.OCTET_STREAM.mime()) .entity(recordingHelper.getActiveInputStream(recording)) .build(); } @@ -1023,6 +1025,7 @@ public Response handleStorageDownload(@RestPath String encodedKey, @RestQuery St .header( HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=\"%s\"", pair.getValue())) + .header(HttpHeaders.CONTENT_TYPE, HttpMimeType.OCTET_STREAM.mime()) .entity(recordingHelper.getArchivedRecordingStream(encodedKey)) .build(); }