From 6646f17b538676ef4f007c994f3d3add407cce3f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 4 Dec 2014 14:16:14 +0100 Subject: [PATCH] SONAR-5292 fix mime type of response api/sources/raw --- .../src/main/java/org/sonar/server/source/ws/RawAction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/sonar-server/src/main/java/org/sonar/server/source/ws/RawAction.java b/server/sonar-server/src/main/java/org/sonar/server/source/ws/RawAction.java index 4f9a3e34a72..155eac9c4d8 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/source/ws/RawAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/source/ws/RawAction.java @@ -69,6 +69,7 @@ public class RawAction implements RequestHandler { try { ComponentDto componentDto = dbClient.componentDao().getByKey(session, fileKey); List lines = sourceService.getLinesAsTxt(componentDto.uuid(), null, null); + response.stream().setMediaType("text/plain"); IOUtils.writeLines(lines, "\n", response.stream().output(), Charsets.UTF_8); } catch (IOException e) { throw new IllegalStateException("Fail to write raw source of file " + fileKey, e); -- 2.39.5