Author: ron.sigal(a)jboss.com
Date: 2009-08-17 22:18:17 -0400 (Mon, 17 Aug 2009)
New Revision: 5352
Modified:
remoting2/branches/2.x/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.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java 2009-08-18
02:17:27 UTC (rev 5351)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/http/HTTPUnMarshaller.java 2009-08-18
02:18:17 UTC (rev 5352)
@@ -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;
}
Show replies by date