Repository: marmotta Updated Branches: refs/heads/develop 477a53866 -> 8348d0dc5
MARMOTTA-562: json if html is not requested Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/8348d0dc Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/8348d0dc Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/8348d0dc Branch: refs/heads/develop Commit: 8348d0dc5e5bfdf687bc191bc94994a6e5bd1616 Parents: 477a538 Author: Sergio Fernández <[email protected]> Authored: Wed Nov 5 16:55:20 2014 +0100 Committer: Sergio Fernández <[email protected]> Committed: Wed Nov 5 16:55:26 2014 +0100 ---------------------------------------------------------------------- .../core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/8348d0dc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java index d91cc43..d7a4163 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/jaxrs/exceptionmappers/HttpErrorExceptionMapper.java @@ -76,9 +76,7 @@ public class HttpErrorExceptionMapper implements CDIExceptionMapper<HttpErrorExc final String acceptHeader = exceptionHeaders.get("Accept"); final ContentType bestContentType = MarmottaHttpUtils.bestContentType(Arrays.asList(MarmottaHttpUtils.parseContentType("text/html"), MarmottaHttpUtils.parseContentType("application/json")), Arrays.asList(MarmottaHttpUtils.parseContentType(acceptHeader))); - if (bestContentType.matches(MarmottaHttpUtils.parseContentType("application/json"))) { - htmlError = false; - } + htmlError = bestContentType.matches(MarmottaHttpUtils.parseContentType("text/html")); } Response.ResponseBuilder responseBuilder;
