abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r655546 - /incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java
Date Mon, 12 May 2008 16:18:34 GMT
Author: jmsnell
Date: Mon May 12 09:18:33 2008
New Revision: 655546

URL: http://svn.apache.org/viewvc?rev=655546&view=rev
Log:
https://issues.apache.org/jira/browse/ABDERA-152 - "JSONFilter throws NPE when the response
content-type is null"

"If the response content-type is null (e.g., when responding with "204 No Content" after DELETE
of an entry), JSONFilter throws a NullPointerException trying to determine whether to send
JSON"

Modified:
    incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java

Modified: incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java?rev=655546&r1=655545&r2=655546&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java
(original)
+++ incubator/abdera/java/trunk/extensions/json/src/main/java/org/apache/abdera/ext/json/JSONFilter.java
Mon May 12 09:18:33 2008
@@ -47,7 +47,8 @@
     FilterChain chain) {
       ResponseContext resp = chain.next(request);
       String format = request.getParameter("format");
-      return jsonPreferred(request,resp.getContentType().toString()) ||
+      return (resp.getContentType() != null &&
+        jsonPreferred(request,resp.getContentType().toString())) ||
         (format != null && format.equalsIgnoreCase("json")) ?
         new JsonResponseContext(resp,request.getAbdera()) :
         resp;



Mime
View raw message