diff --git a/web/app/controllers/resources/Accept.java b/web/app/controllers/resources/Accept.java index 21d3b5ae7c..6411df5836 100644 --- a/web/app/controllers/resources/Accept.java +++ b/web/app/controllers/resources/Accept.java @@ -19,8 +19,8 @@ private Accept() { } enum Format { - BULK("jsonl", "application/x-jsonlines"), // JSON_LD("json(.+)?", "application/json", "application/ld+json"), // + BULK("jsonl", "application/x-jsonlines"), // HTML("html", "text/html"), // RDF_XML("rdf", "application/rdf+xml", "application/xml", "text/xml"), // N_TRIPLE("nt", "application/n-triples", "text/plain"), // diff --git a/web/test/tests/AcceptIntegrationTest.java b/web/test/tests/AcceptIntegrationTest.java index ef27ccf453..36090763f4 100644 --- a/web/test/tests/AcceptIntegrationTest.java +++ b/web/test/tests/AcceptIntegrationTest.java @@ -37,8 +37,11 @@ public static Collection data() { return Arrays.asList(new Object[][] { // search, default format: JSON { fakeRequest(GET, "/resources/search?q=*"), /*->*/ "application/json" }, + { fakeRequest(GET, "/resources/search?q=*").header("Accept", "*/*"), /*->*/ "application/json" }, + { fakeRequest(GET, "/resources/search?q=*").header("Accept", "application/x-jsonlines"), /*->*/ "application/x-jsonlines" }, { fakeRequest(GET, "/resources/search?q=*&format="), /*->*/ "application/json" }, { fakeRequest(GET, "/resources/search?q=*&format=json"), /*->*/ "application/json" }, + { fakeRequest(GET, "/resources/search?q=*&format=jsonl"), /*->*/ "application/x-jsonlines" }, { fakeRequest(GET, "/resources/search?q=*&format=whatever"), /*->*/ "application/json" }, { fakeRequest(GET, "/resources/search?q=*").header("Accept", "text/plain"), /*->*/ "application/json" }, // search, others formats as query param: