cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1376146 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
Date Wed, 22 Aug 2012 17:07:37 GMT
Author: sergeyb
Date: Wed Aug 22 17:07:37 2012
New Revision: 1376146

URL: http://svn.apache.org/viewvc?rev=1376146&view=rev
Log:
Minor update to DepthRestrictingInInterceptor to do the best effort in ignoring all non-xml
payloads

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java?rev=1376146&r1=1376145&r2=1376146&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
Wed Aug 22 17:07:37 2012
@@ -36,8 +36,7 @@ import org.apache.cxf.staxutils.StaxUtil
  * Creates an XMLStreamReader from the InputStream on the Message.
  */
 public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<Message>
{
-    private static final String FORM_CONTENT_TYPE = "application/x-www-form-urlencoded";
-    private static final String JSON_CONTENT_TYPE = "application/json";
+    private static final String XML_SUB_TYPE = "xml";
     private int elementCountThreshold = 2000;
     private int innerElementLevelThreshold = 20;
     private int innerElementCountThreshold = 50;
@@ -92,7 +91,7 @@ public class DepthRestrictingStreamInter
     // custom subclasses can further customize it
     protected boolean canBeIgnored(Message message) {
         String ct = (String)message.get(Message.CONTENT_TYPE);
-        return ct != null && (FORM_CONTENT_TYPE.equals(ct) || JSON_CONTENT_TYPE.equals(ct));
+        return ct != null && !ct.contains(XML_SUB_TYPE);
     }
     
     /**



Mime
View raw message