cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1478579 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: interceptor/JAXRSInInterceptor.java utils/JAXRSUtils.java
Date Thu, 02 May 2013 21:42:36 GMT
Author: sergeyb
Date: Thu May  2 21:42:36 2013
New Revision: 1478579

URL: http://svn.apache.org/r1478579
Log:
Minor updates to the way Content-Type is set when it is not available

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1478579&r1=1478578&r2=1478579&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Thu May  2 21:42:36 2013
@@ -20,7 +20,6 @@
 package org.apache.cxf.jaxrs.interceptor;
 
 import java.io.IOException;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -38,7 +37,6 @@ import javax.ws.rs.core.Response;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.jaxrs.impl.RequestPreprocessor;
 import org.apache.cxf.jaxrs.impl.UriInfoImpl;
@@ -128,15 +126,7 @@ public class JAXRSInInterceptor extends 
         
         String requestContentType = (String)message.get(Message.CONTENT_TYPE);
         if (requestContentType == null) {
-            boolean getMethod = HttpMethod.GET.equals(httpMethod);
-            requestContentType = getMethod ? MediaType.WILDCARD : MediaType.APPLICATION_OCTET_STREAM;
-            message.put(Message.CONTENT_TYPE, requestContentType);
-            if (!getMethod) {
-                Map<String, List<String>> headers = CastUtils.cast((Map<?,
?>)message.get(Message.PROTOCOL_HEADERS));
-                if (headers != null) {
-                    headers.put(Message.CONTENT_TYPE, Collections.singletonList(requestContentType));
   
-                }
-            }
+            requestContentType = MediaType.WILDCARD;
         }
         
         String rawPath = HttpUtils.getPathToMatch(message, true);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1478579&r1=1478578&r2=1478579&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Thu
May  2 21:42:36 2013
@@ -823,8 +823,7 @@ public final class JAXRSUtils {
             String contentType = (String)message.get(Message.CONTENT_TYPE);
 
             if (contentType == null) {
-                // for tests only
-                contentType = MediaType.WILDCARD;
+                contentType = MediaType.APPLICATION_OCTET_STREAM;
             }
 
             return readFromMessageBody(parameterClass,



Mime
View raw message