You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2014/11/05 16:55:49 UTC

git commit: MARMOTTA-562: json if html is not requested

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 <wi...@apache.org>
Authored: Wed Nov 5 16:55:20 2014 +0100
Committer: Sergio Fernández <wi...@apache.org>
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;