[jboss-remoting-commits] JBoss Remoting SVN: r5351 - remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/http.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Aug 17 22:17:27 EDT 2009


Author: ron.sigal at jboss.com
Date: 2009-08-17 22:17:27 -0400 (Mon, 17 Aug 2009)
New Revision: 5351

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java
Log:
JBREM-1145: Uses "remotingContentType" to determine of payload is a String.

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java	2009-08-17 22:27:22 UTC (rev 5350)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java	2009-08-18 02:17:27 UTC (rev 5351)
@@ -26,7 +26,6 @@
 import org.jboss.remoting.marshal.UnMarshaller;
 import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
 import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.remoting.transport.web.WebUtil;
 
 import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
@@ -234,23 +233,22 @@
       if(metadata != null)
       {
          // need to get the content type
-         Object value = metadata.get("Content-Type");
-         if(value == null)
+         String remotingContentType = null;
+         Object o = metadata.get(HTTPMetadataConstants.REMOTING_CONTENT_TYPE);
+         if (o instanceof List)
          {
-            value = metadata.get("content-type");
+            remotingContentType = (String) ((List) o).get(0);
          }
-         if(value != null)
+         else if (o instanceof String)
          {
-            if(value instanceof List)
-            {
-               List valueList = (List) value;
-               if(valueList != null && valueList.size() > 0)
-               {
-                  value = valueList.get(0);
-               }
-            }
-            isBinary = WebUtil.isBinary((String) value);
+            remotingContentType = (String) o;
          }
+         else 
+         {
+            log.warn(this + " unrecognized remotingContentType: " + o);
+         }
+
+         isBinary = HTTPMetadataConstants.REMOTING_CONTENT_TYPE_NON_STRING.equals(remotingContentType);
       }
       return isBinary;
    }



More information about the jboss-remoting-commits mailing list