Fix content-type for RTF download
Change-Id: I2725b1c064ccb50c9b2d94f74cdee621d92d3ddd
diff --git a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
index bd715e0..61b2800 100644
--- a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
+++ b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/IdsExportService.java
@@ -243,7 +243,6 @@
LinkedList<MatchExport> listMatches = new LinkedList();
ObjectMapper objectMapper = new ObjectMapper();
MatchExport match;
-
for (Iterator<JsonNode> itNode = jsonNode1.elements(); itNode
.hasNext();) {
@@ -254,6 +253,7 @@
String rtfresp = writeRTF(listMatches);
builder = Response.ok(rtfresp);
+ builder.type("application/rtf");
format = "rtf";
}
diff --git a/plugin/src/test/java/de/ids_mannheim/korap/plkexport/IdsExportServiceTest.java b/plugin/src/test/java/de/ids_mannheim/korap/plkexport/IdsExportServiceTest.java
index 0761da7..329461c 100644
--- a/plugin/src/test/java/de/ids_mannheim/korap/plkexport/IdsExportServiceTest.java
+++ b/plugin/src/test/java/de/ids_mannheim/korap/plkexport/IdsExportServiceTest.java
@@ -255,7 +255,7 @@
Status.OK.getStatusCode(), responsertf.getStatus());
// An RTF document should be returned
assertEquals("Request RTF: Http Content-Type should be: ",
- MediaType.APPLICATION_OCTET_STREAM,
+ "application/rtf",
responsertf.getHeaderString(HttpHeaders.CONTENT_TYPE));
// Results should not be displayed inline but saved and displayed locally
assertTrue("Request RTF: Results should not be displayed inline",