correct excel mime types (#2596)

* correct excel mime types

* address PR issue

* remove use of wildcard
This commit is contained in:
PJ Fanning 2020-04-26 14:36:37 +02:00 committed by GitHub
parent 88f7fb2852
commit 1a0e187561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -65,7 +65,7 @@ public class XlsExporter implements StreamExporter {
@Override
public String getContentType() {
return xml ? "application/xlsx" : "application/xls";
return xml ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : "application/vnd.ms-excel";
}
@Override

View File

@ -106,6 +106,11 @@ public class XlsExporterTests extends RefineTest {
options = null;
}
@Test
public void getContentType(){
Assert.assertEquals(SUT.getContentType(), "application/vnd.ms-excel");
}
@Test
public void exportSimpleXls(){
CreateGrid(2, 2);

View File

@ -110,6 +110,11 @@ public class XlsxExporterTests extends RefineTest {
options = null;
}
@Test
public void getContentType(){
Assert.assertEquals(SUT.getContentType(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
}
@Test
public void exportSimpleXlsx(){
CreateGrid(2, 2);

View File

@ -291,7 +291,9 @@ function registerImporting() {
IM.registerMimeType("application/x-excel", "binary/text/xml/xls/xlsx");
IM.registerMimeType("application/xls", "binary/text/xml/xls/xlsx");
IM.registerMimeType("application/x-xls", "binary/text/xml/xls/xlsx");
IM.registerMimeType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "binary/text/xml/xls/xlsx");
IM.registerMimeType("application/vnd.openxmlformats-officedocument.spreadsheetml.template", "binary/text/xml/xls/xlsx");
IM.registerMimeType("application/vnd.oasis.opendocument.spreadsheet","text/xml/ods");
IM.registerMimeType("application/json", "text/json");