]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5292 fix mime type of response api/sources/raw
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 4 Dec 2014 13:16:14 +0000 (14:16 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 4 Dec 2014 13:16:14 +0000 (14:16 +0100)
server/sonar-server/src/main/java/org/sonar/server/source/ws/RawAction.java

index 4f9a3e34a72afdd9e42cf268ba0c8b68900a9257..155eac9c4d8e13ae2875e54c60189a40395cb001 100644 (file)
@@ -69,6 +69,7 @@ public class RawAction implements RequestHandler {
     try {
       ComponentDto componentDto = dbClient.componentDao().getByKey(session, fileKey);
       List<String> 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);